#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  char ch[100][100];
  for (int i = 1; i <= n; i++) scanf("%s", ch[i] + 1);
  int ans = 0;
  for (int j = 1; j <= m; j++) {
    int s = 0;
    for (int i = 1; i <= n; i++)
      if (ch[i][j] == 'Y') s++;
    if (s >= k) ans++;
  }
  cout << ans << endl;
  return 0;
}
