Codeforces Round 192 (Div. 2)
A
Cakeminator
Codeforces
800
原题
←B →
翻译中…

You are given a rectangular cake, represented as an $*r* × *c*$ grid. Each cell either has an evil strawberry, or is empty. For example, a $3 × 4$ cake may look as follows:

翻译中…

image

翻译中…

The cakeminator is going to eat the cake! Each time he eats, he chooses a row or a column that does not contain any evil strawberries and contains at least one cake cell that has not been eaten before, and eats all the cake cells there. He may decide to eat any number of times.

翻译中…

Please output the maximum number of cake cells that the cakeminator can eat.

翻译中…

Input

翻译中…

The first line contains two integers $*r*$ and $*c*$ ($2 ≤ *r*, *c* ≤ 10$), denoting the number of rows and the number of columns of the cake. The next $*r*$ lines each contains $*c*$ characters — the $*j*$-th character of the $*i*$-th line denotes the content of the cell at row $*i*$ and column $*j*$, and is either one of these:

翻译中…
  • '.' character denotes a cake cell with no evil strawberry;
  • 'S' character denotes a cake cell with an evil strawberry.
翻译中…

Output

翻译中…

Output the maximum number of cake cells that the cakeminator can eat.

翻译中…

Note

翻译中…

For the first example, one possible way to eat the maximum number of cake cells is as follows (perform 3 eats).

翻译中…

image

翻译中…

image

翻译中…

image

翻译中…

样例

Input #1
3 4
S...
....
..S.
Output #1
8
InputCopy OutputCopy
题目信息
题号
330A
时间限制
1 s
内存限制
256 MB
标签
暴力
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。