#include <bits/stdc++.h>
int a[200005];
int main(int argc, char const *argv[]) {
  int i, n, t, c;
  int flag, j, count, sum;
  while (scanf("%d%d%d", &n, &t, &c) != EOF) {
    count = 0;
    sum = 0;
    for (i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
      if (a[i] <= t)
        sum++;
      else {
        if (sum >= c) count += (sum - c + 1);
        sum = 0;
      }
    }
    if (sum >= c) count += (sum - c + 1);
    printf("%d\n", count);
  }
  return 0;
}
