#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n, t, i, ans = 0, x = -1;
  int c, el;
  cin >> n >> t >> c;
  vector<long long> v;
  v.push_back(x);
  for (i = 0; i < n; i++) {
    cin >> x;
    if (x > t) v.push_back(i);
  }
  v.push_back(n);
  for (i = 1; i < v.size(); i++) {
    el = v[i] - v[i - 1] - 1;
    ans += max(0, el - c + 1);
  }
  cout << ans;
  return 0;
}
