#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int A[n], m = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    m = max(m, A[i]);
  }
  int cnt = 0, pos = 0;
  while (pos < n) {
    int curr = 0;
    while (pos < n && A[pos] == m) curr++, pos++;
    cnt = max(cnt, curr);
    pos++;
  }
  cout << cnt << endl;
}
