#include "bits/stdc++.h" #define REP(i,n,N) for(ll i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<> typedef long long ll; using namespace std; const ll inf=1e18; ll N; string s[6]; int main(){ while(cin>>N){ REP(i,0,N){ cin>>s[i]; } ll ans=10; vector win(6); vector> ca; //{i,j}:0 i win , 1 j win REP(i,0,N){ REP(j,i+1,N){ if(s[i][j]=='o') win[i]++; else if(s[i][j]=='x') win[j]++; else ca.push_back({i,j}); } } REP(mask,0,(1< score = win; REP(i,0,ca.size()) { if(mask & (1< s; s.insert(score[0]); REP(i,1,N){ if(score[i]>score[0]){ s.insert(score[i]); } } ans=min(ans,s.size()); } p(ans); } return 0; }