#include <bits/stdc++.h>
int main() {
  char buf[2048];
  int F, I, T;
  int i, j, ans, kitten;
  scanf("%d %d %d", &F, &I, &T);
  int likes[10][10];
  for (i = 0; i < F; i++) {
    scanf("%s", buf);
    for (j = 0; j < I; j++) {
      likes[i][j] = buf[j] == 'Y';
    }
  }
  ans = 0;
  for (i = 0; i < I; i++) {
    kitten = 0;
    for (j = 0; j < F; j++) {
      if (likes[j][i]) kitten++;
    }
    if (kitten >= T) {
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
