import java.io.*; import java.util.*; import java.math.*; class Main79 { public static void out (Object out) { System.out.println(out); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] nums = new int[7]; String[] line = br.readLine().split(" "); for (int i = 0; i < n; i++) nums[Integer.parseInt(line[i])]++; int ans = 0, max = 0; for (int i = 1; i <= 6; i++) { if (max <= nums[i]) { max = nums[i]; ans = i; } } out(ans); } }