print((sum(float(s[:-4])*[380000,1][s[-4]>'C']for s in open(0).readlines()[1:])))
print((sum(float(s[:-4])*(s[-4]>'C'or 380000)for s in open(0).readlines()[1:])))
print((sum(float(s[:-4]) * [380000, 1][s[-4] > "C"] for s in open(0).readlines()[1:])))

print((sum(float(s[:-4]) * (s[-4] > "C" or 380000) for s in open(0).readlines()[1:])))

-print((sum(float(s[:-4]) * [380000, 1][s[-4] > "C"] for s in open(0).readlines()[1:]))) +print((sum(float(s[:-4]) * (s[-4] > "C" or 380000) for s in open(0).readlines()[1:])))