#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<double, int> > v;
  int i;
  for (i = 0; i < n; i++) {
    double x;
    cin >> x;
    v.push_back(make_pair(x, i));
  }
  sort(v.begin(), v.end());
  double f = 0;
  double max = 0;
  int c = 0, maxc = 0;
  for (i = n - 1; i >= 0; i--) {
    f += v[i].first;
    if (max <= (f / (n - i))) {
      max = f / (n - i);
      if (i == n - 1)
        c++;
      else if (abs(v[i].second - v[i + 1].second) == 1)
        c++;
      else {
        if (maxc < c) maxc = c;
        c = 1;
      }
    } else
      break;
  }
  if (maxc < c) maxc = c;
  cout << maxc;
}
