#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
long long int a, b, c, n, m, x = 0, cnt = 0;
string s, o, name = "shohrukh";
vector<int> v;
vector<int> ve;
long long min = 1e7 + 9;
int main() {
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    v.push_back(arr[i]);
  }
  if (n == 1) {
    cout << 1;
    return 0;
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    if (v[0] == arr[i]) {
      cnt++;
    } else if (v[0] != arr[i]) {
      ve.push_back(cnt);
      cnt = 0;
    }
  }
  ve.push_back(cnt);
  sort(ve.begin(), ve.end());
  reverse(ve.begin(), ve.end());
  cout << ve[0];
}
