#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t, c;
  cin >> n >> t >> c;
  vector<long long> arr;
  arr.push_back(-1);
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (x > t) arr.push_back(i);
  }
  arr.push_back(n);
  long long diff, res = 0;
  for (long long i = 1; i < arr.size(); i++) {
    diff = arr[i] - arr[i - 1] - 1;
    res += max(diff - c + 1, (long long)0);
  }
  cout << res << endl;
}
