#include <bits/stdc++.h>
using namespace std;
long long n, t, m, res;
long long a;
vector<long long> x;
int main() {
  cin >> n >> t >> m;
  x.push_back(-1);
  for (long long i = 0; i < n; ++i) {
    cin >> a;
    if (a > t) x.push_back(i);
  }
  x.push_back(n);
  for (long long i = 1; i <= x.size() - 1; ++i) {
    long long L = x[i] - x[i - 1] - 1;
    if (L >= m) res += L - m + 1;
  }
  cout << res;
}
