#include <bits/stdc++.h>
using namespace std;
const long long int M = 1000000007;
long long int mod(long long int x) { return (x % M + M) % M; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, t, c, ans = 0, g = 0, cnt = 0;
  cin >> n >> t >> c;
  long long int arr[n];
  for (long long int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  for (long long int i = 0; i < n; i++) {
    g++;
    if (arr[i] > t) {
      g = 0;
    } else {
      if (g >= c) ans += 1;
    }
  }
  cout << ans << endl;
  cerr << fixed << setprecision(10);
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
