Problem list
Log in
#coci00548 · COCI 2019/2020 Contest 5

Emacs

Silver IV 1.0 s 512 MB

While playing in his favourite text editor, Daniel decided to draw a picture that was $N$ characters high and $M$ characters wide. The picture consists solely of characters ’.’ and ’’ such that characters ’’ form some non-overlapping rectangles. The rectangles don’t even touch each other on their sides or corners. Help Daniel count the number of rectangles drawn on the picture.

Input

The first line contains two integers $N$ and $M$ ($1 \le N$, $M \le 100$) from task description. Each of the next $N$ lines contains $M$ characters ’.’ or ’*’ which represent the picture that Daniel drew.

Output

In a single line you should output the number of rectangles on the picture.

Constraints

In the test cases worth a total of 10 points, all rectangles will consist of a single ’*’ character. In the test cases worth additional 15 points, it will hold $N = 1$.

Example 1

Input
6 7
***....
***..**
.....**
.***.**
.***...
.***...
Output
3

Example 2

Input
3 3
*.*
...
*.*
Output
4

Example 3

Input
1 10
.*.**.***.
Output
3
Source
COCI 2019/2020 Contest 5
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code