#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() using namespace std; using lint = long long; int main() { int n; cin >> n; vector> s(n, vector(n)); rep(i, n) { rep(j, n) { cin >> s[i][j]; } } rep(j, n) { if (s[0][j] == '-') { s[0][j] = 'o'; s[j][0] = 'x'; } } vector cnt(n, 0); rep(i, n) { rep(j, n) { if (s[i][j] == 'o') { cnt[i]++; } } } rep(i, n) { rep(j, n) { if (s[i][j] == '-') { if (cnt[i] <= cnt[j]) { s[i][j] = 'o'; s[j][i] = 'x'; cnt[i]++; } else { s[i][j] = 'x'; s[j][i] = 'o'; cnt[j]++; } } } } vector> v(100); rep(i, n) { v[cnt[i]].emplace_back(i); } int ans = 1; for (int i = 99; i >= 0; i--) { for (auto x : v[i]) { if (x == 0) { cout << ans << endl; return 0; } } if (v[i].size() > 0) { ans++; } } }