#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int C, N;
  long long x, T;
  cin >> N >> T >> C;
  v.push_back(-1);
  for (int i = 0; i < N; i++) {
    cin >> x;
    if (x > T) v.push_back(i);
  }
  v.push_back(N);
  long long cnt = 0;
  for (unsigned int i = 1; i < v.size(); i++) {
    int len = v[i] - v[i - 1] - 1;
    cnt += max(len - C + 1, 0);
  }
  cout << cnt;
  return 0;
}
