#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int mx = -1;
  int p = -1;
  int ans = 1;
  int anssave = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] > mx) {
      mx = a[i];
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == mx) {
      int j;
      for (j = i + 1;; j++) {
        if (j <= n && a[j] == a[i]) {
          anssave++;
        } else {
          ans = max(ans, anssave);
          i = j;
          anssave = 1;
          break;
        }
      }
    }
  }
  ans = max(ans, anssave);
  cout << ans << endl;
  return 0;
}
