#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, t, c, i, s = 0, p = 0;
  cin >> n >> t >> c;
  long long int a[n];
  for (auto i = 0; i < n; i++) cin >> a[i];
  for (auto i = 0; i < n; i++) {
    if (a[i] <= t) {
      p++;
    } else {
      if (p < c) {
        p = 0;
        continue;
      }
      s += p - c + 1;
      p = 0;
    }
  }
  if (p != 0 && p >= c) s += p - c + 1;
  cout << s;
  return 0;
}
