Где ошибка?
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.List;
/*
Cамая длинная последовательность
*/
public class Solution {
public static void main(String[] args) throws IOException {
ArrayList<Integer> list =new ArrayList<Integer>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int count =1;
int length=0;
for (int i = 0; i <10 ; i++) {
list.add(Integer.parseInt(reader.readLine()));
}
for(int i=0; i<9;i++){
if(list.get(i).equals(list.get(i + 1))){
count++;
if(count>length) {
length = count;
}
}else{
count = 1;
}
}
if(count==1){
System.out.println(count);
}else {
System.out.println(length);
}
}
}