def read_data(): N = int(input()) wins = [] xs = [] for i in range(N): oxs = input() win = 0 for j, ox in enumerate(oxs): if ox == 'o': win += 1 elif ox == '-' and j > i: xs.append((i, j)) wins.append(win) return wins, xs def solve(wins, xs): n = len(xs) min_rank = len(wins) for bits in range(2**n): wins_tmp = calc_wins(wins, xs, bits) rank = calc_rank(wins_tmp) if min_rank > rank: min_rank = rank return min_rank def calc_wins(wins, xs, bits): wins_tmp = wins[:] for i, j in xs: if bits & 1: wins_tmp[i] += 1 else: wins_tmp[j] += 1 bits >>= 1 return wins_tmp def calc_rank(wins): n_wins = wins[0] wins = list(set(wins)) wins.sort(reverse=True) return wins.index(n_wins) + 1 if __name__ == '__main__': wins, xs = read_data() print(solve(wins, xs))