#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[200001];
int main() {
  int i, j;
  int t, c;
  string s;
  cin >> n >> t >> c;
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  i = 0;
  while (a[i] > t) i++;
  int dem = 0;
  int rs = 0;
  while (i < n) {
    int j = 0;
    while (a[i] <= t && i < n) {
      j++;
      i++;
    }
    if (j >= c) {
      dem += (j - c + 1);
    }
    while (a[i] > t && i < n) {
      i++;
    }
  }
  cout << dem;
}
