#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, c;
  cin >> n >> t >> c;
  int ar[n];
  for (int i = 0; i < n; i++) cin >> ar[i];
  vector<int> vp;
  for (int i = 0; i < n; i++) {
    if (ar[i] > t) vp.push_back(i);
  }
  int nx = vp.size();
  int count = 0;
  int xc;
  for (int i = 0; i < nx; i++) {
    xc = vp[i] - c;
    if (xc >= 0) {
      if (i == 0)
        count += xc + 1;
      else {
        if (xc > vp[i - 1]) count += xc - vp[i - 1];
      }
    }
  }
  int xcv;
  if (nx == 0)
    count = n - c + 1;
  else {
    if (vp[nx - 1] != n - 1) {
      xcv = (n - 1 - vp[nx - 1] - c + 1);
      if (xcv > 0) count += xcv;
    }
  }
  cout << count;
}
