static int count = 1, max = 1;
public static void main(String[] args) throws IOException {
List<Integer> list = new ArrayList<>();
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 10; i++){
list.add(sc.nextInt());
}
for (int i = 1; i < 10; i++) {
if (list.get(i).equals(list.get(i - 1))) count++;
if (max < count) max = count;
else count = 1;
}
System.out.println(max);
}
}
package com.javarush.task.task08.task0812;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Solution {
static int count = 1, max = 1;
public static void main(String[] args) throws IOException {
List<Integer> list = new ArrayList<>();
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 10; i++){
list.add(sc.nextInt());
}
for (int i = 1; i < 10; i++) {
if (list.get(i).equals(list.get(i - 1))) count++;
if (max < count) max = count;
else count = 1;
}
System.out.println(max);
}
}