#include <bits/stdc++.h>
using namespace std;
vector<int> H;
int N, ans = 1, last;
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    int x;
    cin >> x;
    H.push_back(x);
  }
  int pos = H.size() - 2;
  last = H[pos];
  while (pos >= 0 && H[pos] >= last) {
    last = H[pos];
    pos--;
    ans++;
  }
  for (int i = pos; i >= 0; i--) {
    if (H[i] == last) ans++;
  }
  cout << ans;
}
