#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ull = unsigned long long; using ll = long long; int main() { int n; cin >> n; vector> board(n,vector(n)); for(auto&& y : board) for(auto&& x : y) cin >> x; int result = -1; for(int i = 0; i < n; ++i) { bool check = true; for(int j = 0; j < n; ++j) { check &= (board.at(j).at(i) == "nyanpass" || board.at(j).at(i) == "-"); } if(check && result == -1) result = i+1; else if(check) { cout << -1 << endl; return 0; } } cout << result << endl; }