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