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