#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ma = INT_MIN;
  cin >> n;
  long long *arr = new long long[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    ma = max(ma, arr[i]);
  }
  long long ans = 1, count;
  ;
  for (int i = 0; i < n - 1;) {
    if (arr[i] == ma) {
      count = 1;
      i++;
      while (i < n) {
        if (arr[i] == ma) {
          count++;
          i++;
        } else
          break;
      }
      ans = max(ans, count);
    }
    i++;
  }
  cout << ans;
}
