import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] types = new int[n]; int one = 0, two = 0, three = 0, four = 0, five = 0; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); switch(types[types_i]) { case 1: one += 1; break; case 2: two += 1; break; case 3: three += 1; break; case 4: four += 1; break; case 5: five += 1; } } int[] occurences = {one, two, three, four, five}; Arrays.sort(occurences); int max = occurences[occurences.length - 1]; ArrayList maxList = new ArrayList<>(); if(one == max) { maxList.add(1); } if(two == max) { maxList.add(2); } if(three == max) { maxList.add(3); } if(four == max) { maxList.add(4); } if(five == max) { maxList.add(5); } System.out.println(Collections.min(maxList)); } }