#include <bits/stdc++.h>
using namespace std;
int a[200005];
int main() {
  ios_base::sync_with_stdio(false);
  int n, i, j, t, c, counter = 0;
  cin >> n >> t >> c;
  for (i = 0; i < n; i++) cin >> a[i];
  i = 0;
  j = 0;
  multiset<int> s;
  while (j < n) {
    if (s.size() < c) {
      s.insert(a[j]);
      j++;
    }
    if (s.size() == c) {
      if (*(s.rbegin()) <= t) counter++;
      s.erase(s.find(a[i]));
      i++;
    }
  }
  cout << counter;
}
