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