There is a special robot being created by your friend that can detect hidden mines on the ground. But after the robot detects all the mines, it can't count. Why it can't do this simple thing? Because your friend didn't program it to count mines. As you already started learning some programming, you can help your friend to do it. Can you help?
You will be given a 2-D grid of size n X n (1 < n < 100). Each cell will be either e or m.
You have to print the number of mines in the grid.
Input | Output |
---|---|
emee meee eeee eeem | 3 |