import bisect N = int(input()) S = [[0, 0, None] for _ in range(N)] for i in range(N): S[i][2] = i for j, s in enumerate(input()): if s == 'o': S[i][1] += 1 elif s == '-': if j == 0: S[0][1] += 1 S[0][0] -= 1 else: S[i][0] += 1 while True: tmp1, tmp2 = sorted(S)[-2:] if tmp1[0] == 0: break tmp1[0] -= 1 tmp2[0] -= 1 if tmp1[1] < tmp2[1]: tmp1[1] += 1 else: tmp2[1] += 1 S[tmp1[2]] = tmp1 S[tmp2[2]] = tmp2 a = sorted(list(set(x[1] for x in S))) print(len(a) - bisect.bisect_left(a, S[0][1]))