#include #include #include #include #include int main() { //std::ifstream inf("Text.txt"); std::cin.rdbuf(inf.rdbuf()); int N; std::cin >> N; int cont = 0; std::vector A(1001, 0); std::string S; for (int i = 0; i < N; i++) { std::cin >> S; for (unsigned int j = 1; j < S.length(); j++) { if (S[j] == '^') { cont++; } } A[cont]++; cont = 0; } int max = *std::max_element(A.begin(), A.end()); auto r_itr = std::find(A.rbegin(), A.rend(), max); int temp = std::distance(A.begin(), r_itr.base()); std::cout << temp - 1 << std::endl; return 0; }