n = int(input())
jpy = 0
btc = 0
for i in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        x = int(x)
        jpy += x
    else:
        x = float(x)
        btc += x
print(jpy + btc*380000.0) n = int(input()) n int(input()) int input() input jpy = 0 jpy 0 btc = 0 btc 0 for i in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        x = int(x)
        jpy += x
    else:
        x = float(x)
        btc += x i range(n) range n x, u = map(str, input().split()) x map(str, input().split()) map str input().split() ().split () input split u if u == 'JPY':
        x = int(x)
        jpy += x
    else:
        x = float(x)
        btc += x u == 'JPY' u 'JPY' x = int(x) x int(x) int x jpy += x jpy x x = float(x) x float(x) float x btc += x btc x print(jpy + btc*380000.0) print jpy + btc*380000.0 jpy btc*380000.0 btc 380000.0 btc = 0 0 btc jpy = 0 0 jpy x = int(x) int(x) x n = int(input()) int(input()) n btc += x x btc u = map(str, input().split()) map(str, input().split()) u jpy += x x jpy x, u = map(str, input().split()) map(str, input().split()) x x = float(x) float(x) x
n = int(input())
jpy = 0
btc = 0
for i in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        x = int(x)
        jpy += x
    else:
        x = float(x)
        btc += x
print(jpy + btc*380000.0)