#include <bits/stdc++.h>
using namespace std;
long long n, t, c, a[200005], ans = 0, num = 0;
int main() {
  scanf("%lld%lld%lld", &n, &t, &c);
  for (int i = 0; i < n; i++) {
    long long b;
    scanf("%lld", &b);
    a[i] = b;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] > t) {
      num = 0;
      continue;
    }
    num++;
    if (num == c) {
      ans++;
      num--;
      continue;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
