#include <bits/stdc++.h>
using namespace std;
int main() {
  int osama, osama1, n, t, c, total = 0, counter = 0;
  cin >> n >> t >> c;
  vector<int> v;
  for (osama = 0; osama < n; osama++) {
    cin >> osama1;
    if (osama1 <= t)
      counter++;
    else {
      if (counter >= c) {
        for (; counter >= c; counter--) total++;
      }
      counter = 0;
    }
  }
  if (counter >= c) {
    for (; counter >= c; counter--) total++;
  }
  cout << total;
}
