#include using namespace std; signed main() { ios::sync_with_stdio(false); int N; cin >> N; vector S(N); for (int i = 0; i < N; ++i) cin >> S[i]; map cnt; for (int i = 0; i < N; ++i) { ++cnt[count(S[i].begin(), S[i].end(), '^')]; } map cnt2; for (auto it = cnt.begin(); it != cnt.end(); ++it) { cnt2[it->second] = it->first; } cout << cnt2.rbegin()->second << endl; return 0; }