#include <bits/stdc++.h>
int main() {
  int q, in, i, j, n, t, c, count, count1;
  scanf("%d %d %d", &n, &t, &c);
  count = 0;
  count1 = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &q);
    if (q <= t)
      count++;
    else {
      if (count >= c) {
        count1 += ((count - c) + 1);
      }
      count = 0;
    }
  }
  if (count >= c) count1 += ((count - c) + 1);
  printf("%d\n", count1);
  return 0;
}
