#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1000000007;
template <typename T>
T gcd(T x, T y) {
  return y == 0 ? x : gcd(y, x % y);
}
template <typename T>
T lcm(const T &a, const T &b) {
  return (a * b) / gcd(a, b);
}
long long int nextPowerOf2(long long int n) {
  long long int count = 0;
  if (n && !(n & (n - 1))) return n;
  while (n != 0) {
    n >>= 1;
    count += 1;
  }
  return 1 << count;
}
long long int raiseToPow(long long int x, long long int power) {
  long long int result;
  long long int i;
  result = 1;
  for (i = 1; i <= power; i++) {
    result = result * x;
  }
  return (result);
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cout.precision(12);
  cout << fixed;
  int n, t, c;
  cin >> n >> t >> c;
  vector<long long int> arr(n), pos;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] > t) pos.push_back(i);
  }
  long long int ans = 0;
  if (pos.size() == 0) {
    cout << n - c + 1;
    return 0;
  }
  if (pos[0] >= c) ans += pos[0] - c + 1;
  for (int i = 1; i < pos.size(); i++) {
    if (pos[i] - pos[i - 1] >= c) ans += pos[i] - pos[i - 1] - c;
  }
  if (n - pos[pos.size() - 1] >= c) ans += n - pos[pos.size() - 1] - c;
  cout << ans;
  cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
  return 0;
}
