n = int(input())
keep = []
ans = 0
for i in range(n):
    s = list(input().split())
    keep.append(s)
for j in range(n):
    st = keep[j]
    if st[1] == 'JPY':
        ans += float(st[0])
    else:
        ans += float(st[0]) * 380000
print(ans) n = int(input()) n int(input()) int input() input keep = [] keep [] ans = 0 ans 0 for i in range(n):
    s = list(input().split())
    keep.append(s) i range(n) range n s = list(input().split()) s list(input().split()) list input().split() ().split () input split keep.append(s) keep.append keep append s for j in range(n):
    st = keep[j]
    if st[1] == 'JPY':
        ans += float(st[0])
    else:
        ans += float(st[0]) * 380000 j range(n) range n st = keep[j] st keep[j] keep j if st[1] == 'JPY':
        ans += float(st[0])
    else:
        ans += float(st[0]) * 380000 st[1] == 'JPY' st[1] st 1 'JPY' ans += float(st[0]) ans float(st[0]) float st[0] st 0 ans += float(st[0]) * 380000 ans float(st[0]) * 380000 float(st[0]) float st[0] st 0 380000 print(ans) print ans s = list(input().split()) list(input().split()) s n = int(input()) int(input()) n st = keep[j] keep[j] st keep = [] [] keep ans += float(st[0]) float(st[0]) ans ans += float(st[0]) * 380000 float(st[0]) * 380000 ans ans = 0 0 ans
n = int(input())
keep = []
ans = 0
for i in range(n):
    s = list(input().split())
    keep.append(s)
for j in range(n):
    st = keep[j]
    if st[1] == 'JPY':
        ans += float(st[0])
    else:
        ans += float(st[0]) * 380000
print(ans)
