n = int(input())
jpy = 0
btc = 0
rate = 380000
for _ in range(n):
    x, y = input().split()
    if y == "JPY":
        jpy += int(x)
    else:
        btc += float(x)
print(jpy + btc * rate) n = int(input()) n int(input()) int input() input jpy = 0 jpy 0 btc = 0 btc 0 rate = 380000 rate 380000 for _ in range(n):
    x, y = input().split()
    if y == "JPY":
        jpy += int(x)
    else:
        btc += float(x) _ range(n) range n x, y = input().split() x input().split() ().split () input split y if y == "JPY":
        jpy += int(x)
    else:
        btc += float(x) y == "JPY" y "JPY" jpy += int(x) jpy int(x) int x btc += float(x) btc float(x) float x print(jpy + btc * rate) print jpy + btc * rate jpy btc * rate btc rate jpy = 0 0 jpy y = input().split() input().split() y btc += float(x) float(x) btc n = int(input()) int(input()) n btc = 0 0 btc rate = 380000 380000 rate x, y = input().split() input().split() x jpy += int(x) int(x) jpy
n = int(input())
jpy = 0
btc = 0
rate = 380000
for _ in range(n):
    x, y = input().split()
    if y == "JPY":
        jpy += int(x)
    else:
        btc += float(x)
print(jpy + btc * rate)
