s = int(input())
m = 0
t = 0
for i in range(s):
    m, n = input().split()
    m = float(m)
    if n == 'JPY':
        t += m
    else:
        t += 380000*m
print(t) s = int(input()) s int(input()) int input() input m = 0 m 0 t = 0 t 0 for i in range(s):
    m, n = input().split()
    m = float(m)
    if n == 'JPY':
        t += m
    else:
        t += 380000*m i range(s) range s m, n = input().split() m input().split() ().split () input split n m = float(m) m float(m) float m if n == 'JPY':
        t += m
    else:
        t += 380000*m n == 'JPY' n 'JPY' t += m t m t += 380000*m t 380000*m 380000 m print(t) print t m, n = input().split() input().split() m n = input().split() input().split() n t += m m t s = int(input()) int(input()) s m = 0 0 m t += 380000*m 380000*m t t = 0 0 t m = float(m) float(m) m
s = int(input())
m = 0
t = 0
for i in range(s):
    m, n = input().split()
    m = float(m)
    if n == 'JPY':
        t += m
    else:
        t += 380000*m
print(t)