#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, maxi, k;
  cin >> n >> k >> maxi;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  if (maxi == 1) {
    int ct = 0;
    for (long long i = 0; i < n; i++) {
      if (arr[i] <= k) ct++;
    }
    cout << ct;
    return 0;
  }
  long long s, e, sum = 0, foo = 0;
  for (long long i = 0; i < n;) {
    s = 0, e = 0;
    if (arr[i] <= k) {
      s = i;
      i++;
      int foo = 0;
      while (arr[i] <= k && i <= n - 1) {
        e = i;
        i++;
        foo = 1;
      }
      if (abs(e - s) - maxi + 1 >= 0 && foo == 1) {
        sum += e - s - maxi + 2;
      }
    } else
      i++;
  }
  cout << sum;
}
