#include <bits/stdc++.h>
using namespace std;
long n, t, c, res;
long a[220000];
set<pair<long, long> > S;
int main() {
  scanf("%ld%ld%ld", &n, &t, &c);
  for (long i = 1; i <= n; i++) scanf("%ld", &a[i]);
  S.clear();
  for (long i = 1; i <= c - 1; i++) S.insert(make_pair(-a[i], i));
  long temp;
  for (long i = c; i <= n; i++) {
    S.insert(make_pair(-a[i], i));
    temp = -(*S.begin()).first;
    if (temp <= t) res++;
    S.erase(make_pair(-a[i - c + 1], i - c + 1));
  }
  cout << res << endl;
  return 0;
}
