please help the poor guy here
package com.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
import java.io.*;
/*
Longest sequence
*/
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 countA = 0;
int countB = 0;
for(int i = 0; i<10; i++){
String s = reader.readLine();
int x = Integer.parseInt(s);
list.add(x);
}
for (int i=0;i<list.size()-1;i++){
if (list.get(i).equals(list.get(i+1))){
countA++;
if(countB<countA){
countB=countA; }
}
else{
countA = 1;
}
}
System.out.println(countB);
}
}