#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b)); }
int lcm(int a, int b) { return (a * (b / gcd(a, b))); }
int fx[] = {0, 0, 1, -1};
int fy[] = {-1, 1, 0, 0};
int a[200005], st[200005];
int main() {
  int n, t, c, i, j;
  while (scanf("%d %d %d", &n, &t, &c) != EOF) {
    for (i = 0; i < n; i++) {
      st[i] = -1;
      scanf("%d", &a[i]);
    }
    for (i = 0; i < n; i++) {
      if (a[i] > t) {
        for (j = i; j >= 0 && j > i - c; j--) {
          if (st[j] == 0) break;
          st[j] = 0;
        }
      }
    }
    int cc = 0;
    for (i = 0; i <= n - c; i++)
      if (st[i] == -1) cc++;
    printf("%d\n", cc);
  }
  return 0;
}
