#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, t, s = 0, r[20] = {0};
  cin >> n >> m >> t;
  char c;
  for (int f = 0; f < n; f++)
    for (int f1 = 0; f1 < m; f1++) {
      cin >> c;
      r[f1] += (c == 'Y');
    }
  for (int f = 0; f < m; f++)
    if (r[f] >= t) s++;
  cout << s << endl;
}
