#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  int t;
  int ans = 0;
  cin >> t;
  vector<vector<char> > g(n, vector<char>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> g[i][j];
    }
  }
  for (int i = 0; i < m; i++) {
    int ans1 = 0;
    for (int j = 0; j < n; j++) {
      if (g[j][i] == 'Y') {
        ans1++;
      }
    }
    if (ans1 >= t) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
