#include <bits/stdc++.h>
int s[10], n, m, k, ans, kitten;
char a[10][10];
int main() {
  std::cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) std::cin >> a[i][j], s[j] += (a[i][j] == 'Y');
  for (int i = 0; i < m; i++)
    if (s[i] >= k) ans++;
  std::cout << ans;
}
