#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T MAX(T a, T b) {
  if (a > b) return a;
  return b;
}
template <class T>
inline T MIN(T a, T b) {
  if (a < b) return a;
  return b;
}
template <class T>
inline T ABS(T x) {
  if (x < 0) return -x;
  return x;
}
inline void OPEN(const string &s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
const static int inf = 1000000000;
int n, t, c, x;
int arr[200005];
int idx = 0;
int main() {
  scanf("%d%d%d", &n, &t, &c);
  for (int(i) = (0); (i) < (n); ++(i)) {
    scanf("%d", &arr[i]);
  }
  long long res = 0;
  int nowSz = 0, awalIdx = 0;
  for (int i = 0; i < c; i++) {
    if (arr[i] > t) {
      nowSz = 0;
      awalIdx = -1;
    } else {
      nowSz++;
      awalIdx = i;
    }
  }
  if (nowSz == c) res++;
  for (int i = c; i < n; i++) {
    if (arr[i] > t) {
      nowSz = 0;
    } else {
      nowSz = min(nowSz + 1, c);
    }
    if (nowSz == c) res++;
  }
  printf("%I64d\n", res);
  return 0;
}
