#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, t, c;
  cin >> n >> t >> c;
  long long ans = 0, cur = 0;
  for (int i = 0; i < int(n); i++) {
    int a;
    cin >> a;
    if (a > t)
      cur = 0;
    else
      cur++, ans += (cur >= c);
  }
  return cout << ans << endl, 0;
  ;
}
