풀이
T=int(input()) score=[] for i in range(T): arrs=[] arr=list(input()) s=0 for i in arr: if i=='O': s=s+1 arrs.append(s) else: s=0 arrs.append(s) score.append(sum(arrs)) for i in score: print(i)