using System.Linq; using System; public class P { public int LvL { get; set; } public int c { get; set; } } public class Hello { public static void Main() { var ps = new P[6]; for (int i = 0; i < 6; i++) ps[i] = new P { LvL = i }; var n = int.Parse(Console.ReadLine().Trim()); string[] line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, int.Parse); for (int i = 0; i < n; i++) ps[a[i] - 1].c++; var ans = ps.OrderByDescending(x => x.c).ThenByDescending(x => x.LvL).First().LvL + 1; Console.WriteLine(ans); } }