Solve
n = int(input()) for i in range(n): ox = list(input()) sum = 0 c = 1 for i in ox: if i == 'O': sum += c c += 1 else: c = 1 print(sum)