#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x;
  cin >> n;
  vector<long long int> a;
  long long int maxm = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
    maxm = max(maxm, x);
  }
  long long int ans = 1;
  for (long long int i = 0; i < n; i++) {
    if (a[i] == maxm) {
      long long int cur = 1;
      long long int j = i + 1;
      while ((j < n) && (a[j] == maxm)) cur++, j++;
      i = j;
      ans = max(ans, cur);
    }
  }
  cout << ans << endl;
}
