#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, t, c, d = 0, ans = 0, j = 0;
  cin >> n >> t >> c;
  int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > t) d = i + 1;
    if (a[i] <= t) {
      j = i + 1 - d;
      if (j >= c) ans++;
    }
  }
  cout << ans;
}
