using System; using System.Collections.Generic; using System.Linq; using static System.Console; class Program { static void Main() { var N = int.Parse(ReadLine()); var a = new int[1100]; for (int i = 0; i < N; i++) { var r = ReadLine(); a[r.Length]++; } var m = a.Max(); WriteLine( a.Select((x,i)=>new{x,i}).Where(b=>b.x==m).OrderBy(c=>c.i).Last().i-2); } }