#include <bits/stdc++.h>
using namespace std;
int n, m, k, i, j, a;
int c[11];
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= m; ++j) {
      char x;
      cin >> x;
      c[j] += (x == 'Y');
    }
  }
  for (i = 1; i <= m; ++i) a += (c[i] >= k);
  cout << a;
  return 0;
}
