#include <bits/stdc++.h>
using namespace std;
double a[100010];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  double current = a[0];
  int ncrt = 1;
  int maxim = current;
  int nmax = 1;
  for (int i = 1; i < n; i++)
    if (a[i] == current) {
      ncrt++;
    } else {
      if (current > maxim || current == maxim && ncrt > nmax) {
        maxim = current;
        nmax = ncrt;
      }
      current = a[i];
      ncrt = 1;
    }
  if (current > maxim || current == maxim && ncrt > nmax) {
    maxim = current;
    nmax = ncrt;
  }
  printf("%d\n", nmax);
  return 0;
}
