#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, t, c;
  cin >> n >> t >> c;
  int ans = 0, count = 0;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    if (temp <= t)
      count++;
    else {
      if (count >= c) ans += count - c + 1;
      count = 0;
    }
  }
  if (count >= c) ans += count - c + 1;
  cout << ans;
  return 0;
}
