#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t, c;
  cin >> n >> t >> c;
  long long a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int ans = 0;
  int co = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] > t) {
      co = 0;
    } else {
      ++co;
      if (co == c) {
        --co;
        ++ans;
      }
    }
  }
  cout << ans;
  return 0;
}
