Kinds of figures#3756

Kinds of figures

1 second
256 megabytes
Very easy

Consider a rectangular table with rows and columns. Each cell of the table is either free (marked as '.') or filled (marked as '*'). Neighboring filled cells form figures. More formally:

Two figures and are called figures of the same kind if and only if one can be obtained from the other by translation (shifting in the plane without rotation).

Your task is to determine the total number of figures and the number of different kinds of figures present in the table.

Input

The input consists of the number of rows (1 \leq N \leq 1234), the number of columns (1 \leq M \leq 1234), and lines, each containing exactly characters: either '*' or '.'.

Output

Print two space-separated integers: the total number of figures and the number of different kinds of figures.

Examples

Example 1

Loading
Loading