#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, c;
  scanf("%d%d%d", &n, &t, &c);
  int a[n + 2], k = 0, ans = 0;
  a[0] = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (x > t) {
      k++;
      a[k] = i;
    }
  }
  a[k + 1] = n + 1;
  for (int i = 1; i <= k + 1; i++) {
    if (a[i] - a[i - 1] > c) ans += a[i] - a[i - 1] - c;
  }
  printf("%d", ans);
  return 0;
}
