#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  long long int n, t, c;
  long long int si = 0;
  cin >> n >> t >> c;
  long long int b[n];
  for (long long int i = 0; i < n; i++) {
    b[i] = 0;
  }
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] <= t) {
      si++;
    }
    if (a[i] > t || si == n || i == n - 1) {
      b[i] = si;
      si = 0;
    }
  }
  long long int cnt = 0;
  for (long long int i = 0; i < n; i++) {
    if (b[i] >= c) {
      cnt = cnt + (b[i] - c + 1);
    }
  }
  cout << cnt << endl;
  return 0;
}
