B - 賃貸マンションの空室 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MiB

配点 : 233 点

問題文

高橋君は H 階建ての賃貸マンションを管理しています。各階には W 室の部屋が横一列に並んでいます。

マンションの様子は H 個の文字列 S_1, S_2, \ldots, S_H で表されます。 S_i の j 文字目は i 階の左から j 番目の部屋の様子で、 o は入居者がいることを、 . は空室であることを表します。

各階について、空室の数を求めてください。

制約

  • 1 \leq H \leq 10
  • 1 \leq W \leq 10
  • S_i は o と . のみからなる長さ W の文字列

入力

入力は以下の形式で標準入力から与えられる。

H W
S_1
S_2
\vdots
S_H
  • 1 行目には、階数 H と各階の部屋数 W がスペース区切りで与えられる。
  • 2 行目から H 行にわたり、 1 + i 行目には i 階の様子を表す文字列 S_i が与えられる。

出力

H 行出力せよ。 i 行目には i 階の空室の数を出力せよ。


入力例 1

2 2
o.
.o

出力例 1

1
1

入力例 2

1 3
ooo

出力例 2

0

入力例 3

3 3
o..
...
o..

出力例 3

2
3
2

入力例 4

1 5
....o

出力例 4

4

入力例 5

2 3
.o.
o..

出力例 5

2
2

Score : 233 pts

Problem Statement

Takahashi manages a rental apartment building with H floors. Each floor has W rooms arranged in a row.

The state of the building is described by H strings S_1, S_2, \ldots, S_H. The j-th character of S_i represents the state of the j-th room from the left on the i-th floor: o means the room is occupied, and . means it is vacant.

For each floor, find the number of vacant rooms.

Constraints

  • 1 \leq H \leq 10
  • 1 \leq W \leq 10
  • S_i is a string of length W consisting only of o and ..

Input

The input is given from Standard Input in the following format:

H W
S_1
S_2
\vdots
S_H
  • The first line contains the number of floors H and the number of rooms on each floor W, separated by a space.
  • The following H lines describe the floors: the (1 + i)-th line contains the string S_i representing the state of the i-th floor.

Output

Print H lines. The i-th line should contain the number of vacant rooms on the i-th floor.


Sample Input 1

2 2
o.
.o

Sample Output 1

1
1

Sample Input 2

1 3
ooo

Sample Output 2

0

Sample Input 3

3 3
o..
...
o..

Sample Output 3

2
3
2

Sample Input 4

1 5
....o

Sample Output 4

4

Sample Input 5

2 3
.o.
o..

Sample Output 5

2
2