for rn in range(int(input())):
data=input().split("X")
total=0
for rn_ in data:
total+=sum([階乘(X)-----階加?!])
print(total)