public class Solution { public static void main(String[] args) throws IOException { //напишите тут ваш код BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ArrayList<Integer> list = new ArrayList<Integer>(); ArrayList<Integer> list1 = new ArrayList<Integer>(); for(int i = 0;i<10;i++){ list.add(Integer.parseInt(br.readLine())); } int count = 1; for(int j = list.size()-1;j>0;j--) { if(list.get(j).equals( list.get(j-1))){ count++; }else if (!list.get(j).equals( list.get(j-1))) { list1.add(count); count = 1; } }//System.out.println(count); int max = 0; for(int i = 0;i<list1.size();i++){ if(list1.get(i)>max){ max = list1.get(i); } } System.out.println(max); } }