public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> list = new ArrayList<Integer>();
        for (int i = 0; i <10 ; i++) {
            list.add(i,Integer.parseInt(reader.readLine()));
        }int max = 0;

        for (int i = 0; i <list.size() ; i++) {
            int x = list.get(i), count =0;
            for (int j = 0; j <list.size() ; j++) {
                if (x ==list.get(j))
                {
                    count++;
                }else break;
                if (max<count) max=count;
            }
        }
        System.out.println(max);
    }
}
Спасибо