#include using namespace std; signed main(){ int N; cin >> N; vector< string > G( N ); for( int i = 0; i < N; ++i ) cin >> G[ i ]; vector< int > win( N ); for( int i = 0; i < N; ++i ){ if( G[ 0 ][ i ] == '-' ) G[ 0 ][ i ] = 'o', G[ i ][ 0 ] = 'x'; if( G[ 0 ][ i ] == 'o' ) ++win[ 0 ]; } for( int i = 1; i < N; ++i ) for( int j = 0; j < N; ++j ) if( G[ i ][ j ] == 'o' ) ++win[ i ]; for( int i = 1; i < N; ++i ) for( int j = i + 1; j < N; ++j ) if( G[ i ][ j ] == '-' ){ if( win[ i ] != win[ j ] ) G[ i ][ j ] = 'o', G[ j ][ i ] = 'x', ++win[ i ]; else G[ j ][ i ] = 'o', G[ i ][ j ] = 'x', ++win[ j ]; } int zcnt = win[ 0 ]; sort( win.begin(), win.end(), greater< int >() ); for( int i = 0, c = 0; i < N; ++i ){ if( i - 1 >= 0 and win[ i ] != win[ i - 1 ] ) ++c; if( zcnt == win[ i ] ) cout << c + 1 << endl, exit( 0 ); } return 0; }