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[] birdType = {0,0,0,0,0,0}; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); switch (types[types_i]) { case 1: birdType[1]++; break; case 2: birdType[2]++; break; case 3: birdType[3]++; break; case 4: birdType[4]++; break; case 5: birdType[5]++; break; } } // your code goes here int i=birdType.length-1; int max = i; while (i>0) { if (birdType[i] >= birdType[max]) { max = i; } //System.out.println(birdType[i] + " - " + max); i--; } System.out.println(max); in.close(); } }