#include <bits/stdc++.h>
using namespace std;
int sum[1000000];
int main() {
  int n;
  int t;
  int c;
  sum[0] = 0;
  cin >> n >> t >> c;
  int a;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    sum[i] = sum[i - 1];
    if (a <= t) sum[i]++;
  }
  int cnt = 0;
  for (int i = c; i <= n; i++) {
    if (sum[i] - sum[i - c] == c) cnt++;
  }
  cout << cnt << endl;
}
