#include <bits/stdc++.h>
using namespace std;
int segtree[1000000];
int v[200000];
int init(int root, int beg, int end) {
  if (beg == end) {
    segtree[root] = v[beg];
    return v[beg];
  }
  int left = 2 * root + 1, right = 2 * root + 2;
  int mid = (beg + end) / 2;
  segtree[root] = max(init(left, beg, mid), init(right, mid + 1, end));
  return segtree[root];
}
int query(int root, int beg, int end, int qbeg, int qend) {
  if (qend < beg || end < qbeg) return 0;
  if (qbeg <= beg && qend >= end) return segtree[root];
  int left = 2 * root + 1, right = 2 * root + 2;
  int mid = (beg + end) / 2;
  return max(query(left, beg, mid, qbeg, qend),
             query(right, mid + 1, end, qbeg, qend));
}
int main(void) {
  int n, t, c;
  int ans = 0, i;
  scanf("%d%d%d", &n, &t, &c);
  for (i = 0; i < n; i++) scanf("%d", &v[i]);
  init(0, 0, n - 1);
  for (i = 0; i + c <= n; i++) {
    if (query(0, 0, n - 1, i, i + c - 1) <= t) ans++;
  }
  printf("%d\n", ans);
}
