#!/usr/bin/env python3 import sys def main(): N = int(input()) l = [0] * 1000 for _ in range(N): s = input() l[len(s[1:-1])] += 1 m = max(l) print(999 - l[::-1].index(m)) return if __name__ == '__main__': main()