#include <bits/stdc++.h>
using namespace std;
long long n, a[100005], acc[100005], ans, mx = -1e9;
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mx = max(mx, a[i]);
  }
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    while (i <= n && a[i] == mx) cnt++, i++;
    ans = max(ans, (long long)cnt);
  }
  cout << ans << endl;
  return 0;
}
