#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, c;
  cin >> n >> t >> c;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int cnt = 0;
  int x = 0;
  for (int i = 0; i < n; i++) {
    if (cnt == c) {
      x++;
      cnt--;
    }
    if (a[i] <= t) {
      cnt++;
    } else
      cnt = 0;
  }
  if (cnt == c) x++;
  cout << x << endl;
}
