# N<=6なのでありうる試合数はマックス15 # 残りの試合に番号を付けてビット全探索できるだろう # 実装が面倒だと思う N = int(input()) S = [] dic = {} num = 0 for i in range(N): temp = list(input()) S.append(temp) for j in range(N): if j > i and temp[j] == '-': dic[num] = (i, j) num += 1 #print(S) #print(dic) ans = N for bit in range(1< i: if bit>>shift & 1 == 1: temp_table[i][j] = 'o' else: temp_table[i][j] = 'x' shift += 1 if j < i: if temp_table[j][i] == 'o': temp_table[i][j] = 'x' elif temp_table[j][i] == 'x': temp_table[i][j] = 'o' #print('bit', bit) #print(temp_table) win_count = [0]*N for i in range(N): win = temp_table[i].count('o') win_count[i] = win #print(win_count) zero_rank = 1 for i in range(N-1, win_count[0], -1): if i in win_count[1:]: zero_rank += 1 ans = min(ans, zero_rank) print(ans)