#include <bits/stdc++.h>
using namespace std;
int n, t, tt, a[200007], res;
int main() {
  cin >> n >> t >> tt;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int d, c;
  d = 1;
  c = 1;
  while (d <= n && c <= n) {
    if (a[c] > t) {
      d = c + 1;
      c = d;
    } else {
      if (c - d + 1 == tt) {
        res++;
        d++;
      }
      c++;
    }
  }
  cout << res;
}
