#include <bits/stdc++.h>
using namespace std;
int n, m, t;
int a[1000][1000];
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  int kitten = 1;
  cin >> n >> m >> t;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      if (c == 'Y')
        a[i][j] = 1;
      else
        a[i][j] = 0;
    }
  }
  int ans = 0;
  for (int j = 0; j < m; j++) {
    int cur = 0;
    for (int i = 0; i < n; i++) cur += a[i][j];
    if (cur >= t) ans++;
  }
  cout << ans << "\n";
  return 0;
}
