#include #include #include #include #include #include #include #define rep(i, n) for(i = 0; i < (n); i++) #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define MOD 1000000007 #define PI 3.14159265358979323846 #define INF 1 << 30 using namespace std; typedef long long ll; typedef pair pp; int main(void) { int num, i, j, win, k = 0; cin >> num; vector d(num); vector pend(num, 0); priority_queue, greater> que; map mp; rep(i, num) cin >> d[i]; rep(i, num) { if (d[0][i] == '-') { d[0][i] = 'o'; d[i][0] = 'x'; } if (d[0][i] == 'o') k++; } for(i = 1; i < num; i++) { win = 0; rep(j, num) { if (d[i][j] == 'o') win++; else if (d[i][j] == '-') pend[i]++; } que.push(make_pair(win, i)); } while (!que.empty()) { pp a = que.top(); que.pop(); if (pend[a.second]) { i = d[a.second].find("-"); d[i][a.second] = d[a.second][i] = '='; pend[a.second]--; pend[i]--; a.first++; que.push(a); } else { if (a.first > k) mp[a.first]; } } cout << mp.size() + 1 << "\n"; return 0; }