#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, c;
  cin >> n >> t >> c;
  vector<int> crimes;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    crimes.push_back(num);
  }
  int result = 0;
  int segment = 0;
  for (int i = 0; i < n; i++) {
    if (crimes[i] <= t) {
      segment++;
    } else {
      segment = 0;
    }
    if (segment == c) {
      result++;
      segment -= 1;
    }
  }
  cout << result << endl;
  return 0;
}
