| The 2024 ICPC Latin America Championship |
|---|
| Закончено |
Two players play the following game on an $$$N \times M$$$ grid:
A winning starting cell is a cell such that the first player wins the game if they place their starting stone there, assuming both players play optimally. Given a description of the initial grid, you must tell how many winning starting cells it has.
The first line contains two integers $$$N$$$ and $$$M$$$ ($$$1 \leq N, M \leq 50$$$) indicating the dimensions of the grid.
Each of the next $$$N$$$ lines contains a string of length $$$M$$$. In the $$$i$$$-th string, the $$$j$$$-th character describes the initial state of cell $$$(i,j)$$$. The character is either "." (dot) denoting an empty cell, or "#" (hash) representing an occupied cell.
Output a single line with an integer indicating the number of winning starting cells.
3 3 #.# ... #.#
4
3 3 ..# ... ...
0
1 4 ...#
2
| Название |
|---|


