/
Time Limit: 2 sec / Memory Limit: 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 が与えられる。
出力
空席の数を 1 行で出力せよ。
入力例 1
2 3 o.. ooo
出力例 1
2
入力例 2
1 4 oooo
出力例 2
0
入力例 3
3 2 .. .o oo
出力例 3
3
入力例 4
5 4 .o.. .ooo .o.. ooo. oooo
出力例 4
8
入力例 5
2 1 . o
出力例 5
1
Score : 233 pts
Problem Statement
Takahashi is looking at the seating chart for a wedding venue. The seats are arranged in H rows and W columns, and the chart is represented by H strings S_1, S_2, \ldots, S_H. The j-th character of S_i represents the state of the seat in the i-th row from the top and the j-th column from the left: o means that someone is sitting there, and . means that the seat is empty.
Find the number of empty seats.
Constraints
- 1 \leq H \leq 10
- 1 \leq W \leq 10
- S_i is a string of length W consisting only of
oand..
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 rows H and the number of columns W, separated by a space.
- The following H lines describe the rows of seats. The (1 + i)-th line contains the string S_i, which represents the seats in the i-th row from the top.
Output
Print the number of empty seats on one line.
Sample Input 1
2 3 o.. ooo
Sample Output 1
2
Sample Input 2
1 4 oooo
Sample Output 2
0
Sample Input 3
3 2 .. .o oo
Sample Output 3
3
Sample Input 4
5 4 .o.. .ooo .o.. ooo. oooo
Sample Output 4
8
Sample Input 5
2 1 . o
Sample Output 5
1