N = int(input()) S = [[c for c in input()] for i in range(N)] for i in range(1, N): if S[0][i] == '-': S[0][i] = 'o' S[i][0] = 'x' win = [0 for i in range(N)] for i in range(N): for j in range(N): if S[i][j] == 'o': win[i] += 1 print(sorted(list(set(win))).index(win[0]))