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