#include <bits/stdc++.h>
struct segment {
  int l, r;
};
int n, t, c;
int cruelty[200000];
segment s[200000];
int sc;
int ans;
int main() {
  scanf("%d %d %d", &n, &t, &c);
  for (int i = 0; i < n; ++i) scanf("%d", &cruelty[i]);
  int last = -1;
  for (int i = 0; i < n; ++i) {
    if (cruelty[i] > t) {
      if (i - last > 1) {
        s[sc].l = last + 1;
        s[sc].r = i - 1;
        ++sc;
      }
      last = i;
    }
  }
  if (last < n - 1) {
    s[sc].l = last + 1;
    s[sc].r = n - 1;
    ++sc;
  }
  for (int i = 0; i < sc; ++i)
    if (s[i].r - s[i].l + 1 >= c) ans += s[i].r - s[i].l - c + 2;
  printf("%d\n", ans);
  return 0;
}
