#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, t, c, i, x, cnt, s = 0;
  cin >> n >> t >> c;
  vector<long long> v;
  cnt = 0;
  for (i = 0; i < n; i++) {
    cin >> x;
    if (x > t) {
      if ((cnt - c + 1) > 0) s += cnt - c + 1;
      cnt = 0;
    } else {
      cnt++;
    }
  }
  if ((cnt - c + 1) > 0) s += cnt - c + 1;
  cout << s << "\n";
  return 0;
}
