Подскажите почему не проходят 3 и 5 условие
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 {
int count = 1;
int begin = 0;
int maxl = 1;
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
ArrayList<Integer> List = new ArrayList<Integer>(10);
for (int i = 0; i < 10; i ++)
{
int a = Integer.parseInt(reader.readLine());
List.add(a);
if (begin >= 1)
{
if (List.get(i-1) == List.get(i))
{
count++;
if (maxl < count)
{
maxl = count;
}
}
else
{
count = 1;
}
}
begin++;
}
System.out.println(maxl);
}
}