using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); string[] A = Console.ReadLine().Split(' '); List aList = new List(); aList.AddRange(A); aList.Sort(); int i = 0; do { if (aList.Count(x => x == aList[i]) > 1) { aList.RemoveAll(x => x == aList[i]); if (aList.Count < i + 1) { break; } } else { i++; } } while (aList.Count != i + 1); Console.WriteLine(aList.Count()); } }