#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, inp;
  cin >> n;
  vector<long long int> v;
  long long int mx = -1;
  for (int i = 0; i < n; i++) {
    cin >> inp;
    v.push_back(inp);
    if (mx < inp) mx = inp;
  }
  long long int cnt = 1, mxcnt = -1;
  for (int i = 0; i < n; i++) {
    if (mx == v[i] && mx == v[i - 1]) {
      cnt++;
    } else {
      cnt = 1;
    }
    if (cnt > mxcnt) {
      mxcnt = cnt;
    }
  }
  cout << mxcnt << '\n';
}
int main() {
  long long int t = 1;
  while (t--) {
    solve();
  }
}
