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