#include <bits/stdc++.h>
int l[200001];
int main() {
  long long i, j, n, t, c, p, m;
  while (scanf("%I64d%I64d%I64d", &n, &t, &c) != EOF) {
    p = 0;
    m = -1;
    for (i = 1; i <= n; i++) scanf("%d", &l[i]);
    for (i = 1; i <= n;) {
      if (m != 0) {
        if (i + c - 1 > n) break;
        for (j = 0; j < c; j++)
          if (l[i + j] > t) break;
        if (j == c) {
          p++;
          m = 0;
          i = i + c;
        } else
          i = i + j + 1;
      } else {
        if (l[i] <= t) {
          p++;
          i++;
        } else {
          i++;
          m = -1;
        }
      }
    }
    printf("%d\n", p);
  }
}
