package m.shin; import java.util.Scanner; public class Con79 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt(); int[] l = new int[6]; for(int i = 0;i < N;i++){ l[s.nextInt()-1]++; } s.close(); int Level = 1; for(int i = 1;i < 6;i++){ if(l[i] >= l[i-1]){ Level = i+1; } } System.out.println(Level); } }