#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
char a[20][20];
int n, m, t;
int main() {
  cin >> n >> m >> t;
  for (int i = 0; i < (int)n; i++)
    for (int j = 0; j < (int)m; j++) cin >> a[i][j];
  int ans = 0;
  for (int j = 0; j < (int)m; j++) {
    int kitten = 0;
    for (int i = 0; i < (int)n; i++) {
      if (a[i][j] == 'Y') kitten++;
    }
    if (kitten >= t) ans++;
  }
  cout << ans;
}
