#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ma = 0, ans = 0, c = 0;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ma = max(ma, a[i]);
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == ma)
      c++;
    else
      c = 0;
    ans = max(ans, c);
  }
  cout << ans << endl;
  return 0;
}
