#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int i, j, k; int n; vector me(1000, -1); vectors(1000); mapmp; vectornum(1000, 0); cin >> n; for (i = 0; i < n; i++) { int cnt = 0; cin >> s[i]; for (j = 0; j < s[i].length(); j++) { if (s[i][j] == '^') { cnt++; } } if (mp.count(cnt) == 0) { mp.insert(pair(cnt,1)); } else { mp[cnt]++; } } map::iterator it; int maxn = 0; for (it = mp.begin(); it != mp.end(); it++) { maxn = max(maxn, (*it).second); } int cnt2 = 0; for (it = mp.begin(); it != mp.end(); it++) { if ((*it).second == maxn) { num[cnt2] = (*it).first; cnt2++; } } sort(num.begin(), num.end(), greater()); cout << num[0] << endl; getchar(); getchar(); return 0; }