using System; using System.Linq; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(a); int cnt = 0; for (int i = 0; i < n - 2; i++) { if (a[i] != a[i + 1] && a[i + 1] != a[i + 2]) { cnt++; } } if (n != 1) { if (a[0] != a[1]) cnt++; if (a[n - 2] != a[n - 1]) cnt++; } else cnt++; Console.WriteLine(cnt); } }