import java.util.*; public class Main { public static void main (String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); TreeMap map = new TreeMap<>(); for (int i = 0; i < n; i++) { int x = sc.next().length(); if (map.containsKey(x)) { map.put(x, map.get(x) + 1); } else { map.put(x, 1); } } int max = 0; int maxIdx = 0; for (Map.Entry entry : map.entrySet()) { if (entry.getValue() >= max) { max = entry.getValue(); maxIdx = entry.getKey(); } } System.out.println(maxIdx - 2); } }