public class StrongestTeam {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = Integer.parseInt(scanner.nextLine());
int[] nums = Arrays.stream(scanner.nextLine().split(","))
.mapToInt(Integer::parseInt).toArray();
int max = Integer.MIN_VALUE;
// 先求出最大值
for (int i = 0; i < n; i++) {
if (nums[i] > max) {
max = nums[i];
}
}
// 将等于最大值的flag数组对应值值为1
int[] flag = new int[n];
for (int i = 0; i < n; i++) {
if (nums[i] == max) {
flag[i] = 1;
}
}
// 求flag数组中连续1最大个数
int maxCount = 0;
int count = 0; // 001101110
for (int i = 0; i < n; i++) {
if (flag[i] == 1) {
count++;
} else {
maxCount = Math.max(count, maxCount);
count = 0;
}
}
maxCount = Math.max(count, maxCount);
System.out.println(maxCount);
}
}