import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int array[] = new int[6]; StringTokenizer st = new StringTokenizer(br.readLine()); for(int i = 0;i < n;i++){ int a = Integer.parseInt(st.nextToken()); array[a]++; } int max = 0; int idx = 0; for(int i = 5;i >= 1;i--){ if(array[i] >= max){ max = array[i]; idx = i; } } System.out.println(idx); } }