Pawn on a Grid

AtCoder
IDabc280_a
Time2000ms
Memory256MB
Difficulty
There is a grid with $H$ rows from top to bottom and $W$ columns from left to right. Each square has a piece placed on it or is empty. The state of the grid is represented by $H$ strings $S_1, S_2, \ldots, S_H$, each of length $W$. If the $j$\-th character of $S_i$ is `#`, the square at the $i$\-th row from the top and $j$\-th column from the left has a piece on it; if the $j$\-th character of $S_i$ is `.`, the square at the $i$\-th row from the top and $j$\-th column from the left is empty. How many squares in the grid have pieces on them? ## Constraints * $1\leq H,W \leq 10$ * $H$ and $W$ are integers. * $S_i$ is a string of length $W$ consisting of `#` and `.`. ## Input The input is given from Standard Input in the following format: $H$ $W$ $S_1$ $S_2$ $\vdots$ $S_H$ [samples]
Samples
Input #1
3 5
#....
.....
.##..
Output #1
3

The following three squares have pieces on them:

*   the square at the $1$\-st row from the top and $1$\-st column from the left;
*   the square at the $3$\-rd row from the top and $2$\-nd column from the left;
*   the square at the $3$\-rd row from the top and $3$\-rd column from the left.

Thus, $3$ should be printed.
Input #2
1 10
..........
Output #2
0

Since no square has a piece on it, $0$ should be printed.
Input #3
6 5
#.#.#
....#
..##.
####.
..#..
#####
Output #3
16
API Response (JSON)
{
  "problem": {
    "name": "Pawn on a Grid",
    "description": {
      "content": "There is a grid with $H$ rows from top to bottom and $W$ columns from left to right. Each square has a piece placed on it or is empty. The state of the grid is represented by $H$ strings $S_1, S_2, \\l",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc280_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There is a grid with $H$ rows from top to bottom and $W$ columns from left to right. Each square has a piece placed on it or is empty.\nThe state of the grid is represented by $H$ strings $S_1, S_2, \\l...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments