/leavesontheground

Primary LanguageCMIT LicenseMIT

Problem K. Leaves on the ground

This repository is a solution to the 'Problem K. Leaves on the ground'.

https://omegaup.com/arena/CodeRushTecPuebla2024/practice/#problems/Leaves-on-the-ground-Code-Rush

Problem K. Leaves on the ground

Points				27.02		Memory limit	32 MiB
Time limit (case)	1s			Time limit (total)			1m0s
Input/Output		Console		Input size limit (bytes)	1000000 KiB

Description

One fine autumn day, Alan was getting ready to have a movie session in his room when his parents told him he had to sweep the leaves from the yard if he wanted time to play. To make things more interesting, Alan proposed to his parents that they give him a coin for each pile of leaves on the ground. To count the piles on the ground, Alan takes a photo from his room and sets out to count them all. A pile of leaves is considered when there are no more leaves around it and only concrete remains.

To speed up his counting, Alan asks for your help to develop a program that will assist him in counting the piles of leaves in his yard. For this, Alan represents the leaves as an 'x' and the ground as an 'o'.

Help Alan how many coind will receive after clean the yard.

Input The first line contains 2 integers n and m (1 ≤ n,m ≤ 300) The next n x m lines contains the characters “x” or “o”, represents the yard.

Output Print the number of coins alan will receive after clear his yard.

Example Cases

Input:

4 5
x x x x o
x x o x o
x x o o o
o o o o o

Output:

1

Input:

4 5
x x o o o
x x o o o
o o x o o
o o o x x

Output:

3