#include <bits/stdc++.h>
using namespace std;
int f[50], kitten, n, m, t, i;
int main() {
  cin >> n >> m >> t;
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) f[j] += s[j] == 'Y';
  }
  for (i = 0; i < m; i++) kitten += f[i] >= t;
  cout << kitten;
}
