public class Solution { public static void main(String[] args) throws IOException { //напишите тут ваш код BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); ArrayList<Integer> list = new ArrayList<>(); for (int i = 0; i < 10; i++) { list.add(Integer.parseInt(reader.readLine())); } int count = 1; int big = 1; for (int i = 0; i < list.size(); i++) { if (list.get(i).equals(list.get(i + 1))) { count++;} if (big < count) big = count; else count = 1; } System.out.println(big); } } Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 10, Size: 10 at java.util.ArrayList.rangeCheck(ArrayList.java:657) at java.util.ArrayList.get(ArrayList.java:433) at com.javarush.task.task08.task0812.Solution.main(Solution.java:22)