Problem Description
Desmond the Moonbear is making dinner for Jiahai and Bradley in order to celebrate the anniversary of the moon landing! To make that occasion even more special, Desmond has created a platter full of their favourite foods, potatoes and peanuts respectively.
However, there's a problem. Jiahai and Bradley are extremely jealous of each other and want to make sure both of them have an equal share of the platter, and Desmond is not being biased against either one of them.
You will be given a grid depicting Desmond's platter:
- 'P' indicates the plate boundary
- '.' indicates an empty spot on the plate
- 'O' indicates a potato on that spot of the platter
- 'N' indicates a peanut on that spot of the platter
Each 'O' and 'N' represents a different potato or peanut. Consecutive 'O's and 'N's do not count as one potato or peanut.
Input
The first line of input will contain H and W, indicating the height and width of the platter.
The next H lines will contain W characters each, describing the platter according to the problem statement.
Output
The output should contain one line with two integers, the number of potatoes and the peanuts respectively. They should be seperated by a single space.
Your output should terminate with a newline.
Limits
1 <= H <= 100
1 <= W <= 100
Sample Input 1
4 4
PPPP
PO.P
PNOP
PPPP
Sample Output 1
2 1