#include <bits/stdc++.h>
int main() {
  int n, t, c, i;
  scanf("%d%d%d", &n, &t, &c);
  int size = 0;
  int result = 0;
  for (i = 0; i < n; i++) {
    int temp;
    scanf("%d", &temp);
    if (temp > t) {
      int t = size - c + 1;
      if (t > 0) {
        result = result + t;
      }
      size = 0;
    } else {
      size++;
    }
  }
  if (size != 0) {
    int p = size - c + 1;
    if (p > 0) {
      result = result + p;
    }
  }
  printf("%d\n", result);
  return 0;
}
