#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  float avg{0};
  int ma{0};
  for (int i = 0; i < n; i++) {
    int s;
    cin >> s;
    a.push_back(s);
    avg += s;
    if (s > ma) ma = s;
  }
  avg /= n;
  int cnt{0}, cntans = 1;
  float ans = ma, sum{0};
  bool b{0};
  for (int i = 0; i < n; i++) {
    if (a[i] == ma) {
      b = 1;
      cnt++;
    }
    if (a[i] != ma) {
      b = 0;
      cnt = 0;
    }
    if (cnt > cntans) {
      cntans = cnt;
    }
  }
  cout << cntans;
  return 0;
}
