#include #include #include #include using namespace std; #define rep(i,n) for(int i=0;i> n; rep(i, n) rep(j, n) { string s; cin >> s; if (s == "nyanpass") A[i][j] = true; else if (s == "-") A[i][j] = true; } int cnt = 0,ans; rep(j, n) rep(i,n){ if (A[i][j]) { if (i == n - 1) { cnt++; ans = j + 1; } continue; } else break; } if (cnt == 1) cout << ans << endl; else cout << -1 << endl; return 0; }