#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
const int inf = 1e9 + 7;
int n;
ll cur, res;
ll a[N];
vector<ll> v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  a[n] = inf;
  for (int i = 0; i <= n; i++) {
    if (a[i] != v[n - 1]) {
      res = max(res, cur);
      cur = 0;
    } else {
      cur++;
    }
  }
  cout << res << '\n';
  return 0;
}
