You stumble across a jungle rumored to have ancient treasures in it. Luckily, you have a map of the jungle with the locations of the treasure chests.
Your map contains the following legend:
||Terrain you may walk through|
||A tree obstructing your path|
||Your starting position|
||A treasure chest|
From any given position, you may travel to an adjacent square as long as it is not covered by a tree.
Given the contents of the map with rows and columns, determine the maximum amount of treasure chests you are able to loot.
The first line of input contains space-separated integers, and .
The next lines of input each contain characters, representing the contents of the map.
It is guaranteed that
S will appear exactly once and all other characters will be present on the legend.
Output a single integer, the total number of treasure chests that are reachable from your starting position.
3 7 S..C.X. XX..X.C C...X..