#include <bits/stdc++.h>
using namespace std;
int M, N;
string s;
const int MAX = 2005;
const int MOD = 1000000007;
int main() {
  int n, t, c;
  while (cin >> n >> t >> c) {
    int tmp = 0, ans = 0;
    bool b = 0;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      if (x <= t) {
        if (tmp < c) tmp++;
        if (tmp == c) ans++;
      } else
        tmp = 0;
    }
    cout << ans << endl;
  }
  return 0;
}
