#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, t, c;
  cin >> n >> t >> c;
  long long int count = 0, before = -1;
  for (long long int i = 0; i < n; ++i) {
    long long int a;
    cin >> a;
    if (a > t) {
      count += max(i - before - c, 0ll);
      before = i;
    }
  }
  count += max(n - before - c, 0ll);
  cout << count;
  return 0;
}
