#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, c;
  ifstream ff("file.txt");
  cin >> n >> t >> c;
  vector<pair<int, int>> v1;
  n++;
  int *A = new int[n];
  int idx1, idx2;
  bool b1 = false;
  A[n - 1] = INT_MAX;
  for (int i = 0; i < n; i++) {
    if (i != n - 1) {
      cin >> A[i];
    }
    if (A[i] <= t) {
      if (b1 == false) {
        b1 = true;
        idx1 = i;
      }
      idx2 = i;
    } else {
      if (b1 == true) {
        v1.push_back(make_pair(idx1 + 1, idx2 + 1));
        b1 = false;
      }
    }
  }
  int vs = v1.size();
  unsigned int sum = 0;
  for (int i = 0; i < vs; i++) {
    if ((v1[i].second - v1[i].first + 1) - c < 0) {
      continue;
    } else {
      sum += (v1[i].second - v1[i].first + 1) - c + 1;
    }
  }
  cout << sum << endl;
  return 0;
}
