#include <bits/stdc++.h>
using namespace std;
long long int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v,
    w, x, y, z, sum = 0, total = 0, res = 0, ans = 0;
int main() {
  scanf("%lld %lld", &n, &t);
  scanf("%lld", &c);
  vector<long long int> ar;
  for (long long int i = 1; i <= n; i++) scanf("%lld", &x), ar.push_back(x);
  sum = res = d = 0;
  for (long long int i = 0; i < n; i++) {
    if (ar[i] > t && c <= d) {
      sum += (d - c + 1);
      d = 0;
    } else if (ar[i] <= t)
      d++;
    else
      d = 0;
  }
  if (d > 0 && c <= d) sum += (d - c + 1);
  printf("%lld\n", sum);
}
