#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, c;
  cin >> n >> t >> c;
  int cnt = 0, ans = 0, cl;
  for (int i = 0; i < n; i++) {
    cin >> cl;
    if (cl <= t)
      cnt++;
    else
      cnt = 0;
    if (cnt == c) {
      cnt--;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
