#include <bits/stdc++.h>
using namespace std;
int rint() {
  int ret;
  scanf("%d", &ret);
  return ret;
}
int main() {
  int n = rint();
  int m = rint();
  int t = rint();
  int cnt[10];
  memset(cnt, 0, sizeof cnt);
  for (int i = 0; i < n; i++) {
    char s[11];
    scanf("%s", s);
    for (int j = 0; j < m; j++)
      if (s[j] == 'Y') cnt[j]++;
  }
  int ans = 0;
  for (int j = 0; j < m; j++)
    if (cnt[j] >= t) ans++;
  printf("%d\n", ans);
  return 0;
}
