#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); map mp; int n; cin >> n; while(n--) { string s; cin >> s; int cnt = 0; for(int i = 0; i < s.size(); i++) { if(s[i] == '^') cnt++; } mp[cnt]++; } int num = 0, mode; for(auto i : mp) { if(i.second >= num) { num = i.second; mode = i.first; } } cout << mode << endl; return 0; }