eolymp
bolt
Try our new interface for solving problems
Problems

Letters Q and F

Letters Q and F

Time limit 2 seconds
Memory limit 512 MiB

Little Lev is learning how to draw letters Q and F. Initially, he has a white grid of size n \times m. Then he will draw several letters of one of the following two shapes:

Lev will not rotate or mirror these two shapes. Every time he draws a new letter, he will choose a position for the letter inside the grid and paint all cells of the shape black. Lev will only draw letters in such a way that before drawing all black cells of the letter are white — that is, he will never paint a cell twice.

You are given the final coloring of the grid. Count the number of letters Q and letters F drawn by Lev.

Input data

The first line contains two integers n and m — the height and the width of the grid (5 \le n \le 300; 3 \le m \le 300).

The next n lines contain m characters each, denoting the final state of the grid. A white cell is denoted by '.', a black cell is denoted by '#'.

It is guaranteed that the grid is a valid result of Lev's drawing.

Output data

Print two integers — the number of letters Q and the number of letters F drawn by Lev, respectively.

Examples

Input example #1
5 3
###
#.#
###
..#
..#
Output example #1
1 0
Input example #2
5 3
###
#..
##.
#..
#..
Output example #2
0 1
Input example #3
5 8
###..###
#.#..#..
###..##.
..#..#..
..#..#..
Output example #3
1 1
Input example #4
8 8
.....###
###..#.#
#.######
###.####
#.###.##
#.#.###.
..#...#.
......#.
Output example #4
2 2

Note

Illustration for the fourth example test:

Author Nikolay Budin