#include "bits/stdc++.h"

#define REP(i, n, N) for(ll i=(n); i<(N); i++)
#define RREP(i, n, N) for(ll i=(N-1); i>=n; i--)
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
#define v2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

ll N;
int main() {
    while (cin >> N) {
        string s;
        map<ll, ll> mp;
        ll ans=0;
        REP(i,0,N){
            cin>>s;
            mp[s.size()-2]++;
        }
        ll mx=0;
        for(auto m:mp){
            if(mx<m.second){
                ans=m.first;
                mx=m.second;
            }else if(mx==m.second){
                ans=max(ans,m.first);
            }
        }
        p(ans);
    }

}