B - Perfect Attendance Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MiB

配点 : 233 点

問題文

高橋君の会社には H 人の社員がいて、 W 日間の出勤記録が付けられています。記録は H 個の文字列 S_1, S_2, \ldots, S_H で表され、 S_i の j 文字目が o なら i 番目の社員は j 日目に出勤し、 x なら出勤しませんでした。

W 日間すべてに出勤した「皆勤」の社員の人数を求めてください。

制約

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

入力

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

H W
S_1
S_2
\vdots
S_H
  • 1 行目には、社員の人数 H と日数 W がスペース区切りで与えられる。
  • 2 行目から H 行にわたり、 1 + i 行目には i 番目の社員の出勤記録を表す文字列 S_i が与えられる。

出力

皆勤の社員の人数を 1 行で出力せよ。


入力例 1

3 3
ooo
xxx
ooo

出力例 1

2

入力例 2

2 2
oo
oo

出力例 2

2

入力例 3

1 1
x

出力例 3

0

入力例 4

3 4
oooo
oooo
oooo

出力例 4

3

入力例 5

1 10
oooooooooo

出力例 5

1

Score : 233 pts

Problem Statement

Takahashi's company has H employees, and attendance records have been kept for W days. The records are given as H strings S_1, S_2, \ldots, S_H. If the j-th character of S_i is o, the i-th employee attended on day j; if it is x, they did not.

Find the number of employees with "perfect attendance," meaning they attended on all W days.

Constraints

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

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 employees H and the number of days W, separated by a space.
  • Over the following H lines, the (1 + i)-th line contains the string S_i representing the attendance record of the i-th employee.

Output

Print the number of employees with perfect attendance on a single line.


Sample Input 1

3 3
ooo
xxx
ooo

Sample Output 1

2

Sample Input 2

2 2
oo
oo

Sample Output 2

2

Sample Input 3

1 1
x

Sample Output 3

0

Sample Input 4

3 4
oooo
oooo
oooo

Sample Output 4

3

Sample Input 5

1 10
oooooooooo

Sample Output 5

1