package com.javarush.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
/*
Cамая длинная последовательность
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList();
int count = 1;
int max = 0;
list.add(Integer.parseInt(reader.readLine()));
for(int i = 1; i < 10; i++){
list.add(Integer.parseInt(reader.readLine()));
if(list.get(i-1).equals(list.get(i))){
count++;
}else{
if(count >= max){
max = count;
count=1;
}
}
}
if(count >= max){
max = count;
}
System.out.println(max);
}
}
package com.javarush.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
/*
Cамая длинная последовательность
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList();
int count = 1;
int max = 0;
list.add(Integer.parseInt(reader.readLine()));
for(int i = 1; i < 10; i++){
list.add(Integer.parseInt(reader.readLine()));
if(list.get(i-1).equals(list.get(i))){
count++;
}else{
if(count >= max){
max = count;
count=1;
}
}
}
if(count >= max){
max = count;
}
System.out.println(max);
}
}