print((sum(380000**('B'in s)*float(s[:-4])for s in open(0).readlines()[1:])))
print((sum(38e4**('B'in s)*float(s[:-4])for s in open(0).readlines()[1:])))
print((sum(380000 ** ("B" in s) * float(s[:-4]) for s in open(0).readlines()[1:])))

print((sum(38e4 ** ("B" in s) * float(s[:-4]) for s in open(0).readlines()[1:])))

-print((sum(380000 ** ("B" in s) * float(s[:-4]) for s in open(0).readlines()[1:]))) +print((sum(38e4 ** ("B" in s) * float(s[:-4]) for s in open(0).readlines()[1:])))