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