#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> h;
int main() {
  cin >> n;
  h.resize(n);
  for (int i = 0; i < n; ++i) cin >> h[i];
  int he = h[n - 1];
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (h[i] <= he) cnt++;
  }
  cout << cnt << '\n';
  return 0;
}
