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