j, b = 0, 0
for _ in range(int(input())):
    m, jb = input().split()
    if jb == "JPY":
        j += int(m)
    else:
        b += float(m)
print(j + 380000 * b) j, b = 0, 0 j 0 b 0 for _ in range(int(input())):
    m, jb = input().split()
    if jb == "JPY":
        j += int(m)
    else:
        b += float(m) _ range(int(input())) range int(input()) int input() input m, jb = input().split() m input().split() ().split () input split jb if jb == "JPY":
        j += int(m)
    else:
        b += float(m) jb == "JPY" jb "JPY" j += int(m) j int(m) int m b += float(m) b float(m) float m print(j + 380000 * b) print j + 380000 * b j 380000 * b 380000 b b += float(m) float(m) b j += int(m) int(m) j m, jb = input().split() input().split() m b = 0, 0 0 b jb = input().split() input().split() jb j, b = 0, 0 0 j
j, b = 0, 0
for _ in range(int(input())):
    m, jb = input().split()
    if jb == "JPY":
        j += int(m)
    else:
        b += float(m)
print(j + 380000 * b)