#include <bits/stdc++.h>
using namespace std;
int n, t, c;
int a[1000005];
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> t >> c;
  for (int i = 0; i < n; i++) cin >> a[i];
  int invalid = 0;
  int res = 0;
  for (int i = 0; i < c; i++)
    if (a[i] > t) invalid++;
  if (invalid == 0) res++;
  for (int i = 1; i <= n - c; i++) {
    if (a[i - 1] > t) invalid--;
    if (a[i + c - 1] > t) invalid++;
    if (invalid == 0) res++;
  }
  cout << res << endl;
  return 0;
}
