#include <bits/stdc++.h>
using namespace std;
const unsigned MAXN = 2e5 + 10;
int A[MAXN];
int F[MAXN];
int n, t, c;
int main() {
  int n;
  scanf("%d%d%d", &n, &t, &c);
  F[0] = 0;
  int cou = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
    if (A[i] > t) {
      F[cou] = i;
      cou++;
    }
  }
  F[cou] = n + 1;
  cou++;
  int result = 0;
  for (int i = 1; i < cou; i++) {
    int l = F[i - 1] + 1, r = F[i] - 1;
    int len = r - l + 1;
    if (len >= c) {
      result += len - c + 1;
    }
  }
  printf("%d", result);
  return 0;
}
