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 birds = in.nextInt(); int[] types = new int[birds]; for (int i = 0; i < birds; i++) { types[i] = in.nextInt(); } int[] typeCount = {0,0,0,0,0}; for (int i = 0; i < birds; i++) { if (types[i] == 1) { typeCount[0]++; } else if (types[i] == 2) { typeCount[1]++; } else if (types[i] == 3) { typeCount[2]++; } else if (types[i] == 4) { typeCount[3]++; } else if (types[i] == 5) { typeCount[4]++; } } int modeID = -1, modeCount = 0; for (int i = 0; i < 5; i++) { if (typeCount[i] > modeCount) { modeCount = typeCount[i]; modeID = i + 1; } else if (typeCount[i] == modeCount) { modeID = Math.min(i, modeID); } } System.out.println(modeID); } }