N = int(raw_input()) S = [[i,list(raw_input())] for i in range(N)] for i in range(N): if S[0][1][i] == '-': S[0][1][i],S[i][1][0] = 'o','x' S = sorted(S,cmp=lambda x,y:cmp(x[1].count('-') + x[1].count('o'),y[1].count('x') + y[1].count('o'))) for i in range(N): for j in range(N): if S[i][1][j] == '-': S[i][1][j],S[j][1][i] = 'o','x' S = sorted(S,cmp=lambda x,y:cmp(x[1].count('o'),y[1].count('o')),reverse=True) rank = 1 prev = S[0][1].count('o') for i in range(0,N): if prev > S[i][1].count('o'): rank += 1 prev = S[i][1].count('o') if S[i][0] == 0: print rank break