#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1e5 + 2;
const int MOD = 1e9 + 7;
const unsigned long long INF = (unsigned long long)(-1LL);
int n, t, c;
int main() {
  cin >> n >> t >> c;
  int continuous = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int d;
    scanf("%d", &d);
    if (d <= t)
      continuous++;
    else {
      if (continuous >= c) ans += continuous - c + 1;
      continuous = 0;
    }
  }
  if (continuous >= c) ans += continuous - c + 1;
  printf("%d\n", ans);
}
