using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder { class Program { static void Main(string[] args) { Dictionary dic = new Dictionary() { { 0, 0 } }; int N = int.Parse(Console.ReadLine()); for (int i = 0; i < N; i++) { int n = Console.ReadLine().Count(c => c == '^'); if (dic.ContainsKey(n)) dic[n]++; else dic.Add(n, 1); } var va = dic.OrderByDescending(a => a.Key).OrderByDescending(x => x.Value).Take(1).ToArray(); Console.WriteLine(va[0].Key); // Console.ReadLine(); } } }