import java.util.Scanner; class N079{ public static void main(String args[]){ Scanner s = new Scanner(System.in); int n = s.nextInt(); int a[] = new int[6]; int max = 0; for(int i = 0; i < n; i++){ int h = s.nextInt(); a[h - 1]++; } for(int i = 0; i < 6; i++){ max = Math.max(max, a[i]); } for(int i = 0; i < 6; i++){ if(a[5 - i] == max){ System.out.println(6 - i); break; } } } }