#include <bits/stdc++.h>
using namespace std;
int arr[200000 + 10];
int main() {
  int n, t, c;
  long long sum = 0;
  long long temp = 0;
  cin >> n >> t >> c;
  int y = 1;
  arr[0] = -1;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    if (temp > t) {
      arr[y] = i;
      y++;
    }
  }
  if (y == 1) {
    cout << n - c + 1;
    return 0;
  }
  for (int j = 1; j < y; j++) {
    if (arr[j] - arr[j - 1] - c < 0)
      ;
    else
      sum += arr[j] - arr[j - 1] - c;
  }
  if (n - 1 - arr[y - 1] - c + 1 < 0)
    ;
  else
    sum += n - 1 - arr[y - 1] - c + 1;
  cout << sum;
  return 0;
}
