#include <bits/stdc++.h>
using namespace std;
int n, t, c, curr, ans, A[200200];
int main() {
  scanf("%d %d %d\n", &n, &t, &c);
  for (int i = 0; i < n; i++) {
    scanf("%d ", &A[i]);
  }
  for (int i = 0; i < n; i++) {
    if (A[i] > t) {
      if (curr - c + 1 > 0) ans += (curr - c + 1);
      curr = 0;
    } else
      curr++;
  }
  printf("%d", ans + ((curr - c + 1 > 0) ? curr - c + 1 : 0));
}
