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