N = int(input())
money, type = [], []
for i in range(N):
    m, t = input().split()
    money.append(float(m))
    type.append(t)

sum = 0
for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5
print(sum) N = int(input()) N int(input()) int input() input money, type = [], [] money [] type [] for i in range(N):
    m, t = input().split()
    money.append(float(m))
    type.append(t) i range(N) range N m, t = input().split() m input().split() ().split () input split t money.append(float(m)) money.append money append float(m) float m type.append(t) type.append type append t sum = 0 sum 0 for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5 i range(N) range N if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5 type[i] == 'JPY' type[i] type i 'JPY' sum += money[i] sum money[i] money i sum += money[i]*3.8*10**5 sum money[i]*3.8*10**5 money[i]*3.8 money[i] money i 3.8 10**5 10 5 print(sum) print sum sum += money[i] money[i] sum sum += money[i]*3.8*10**5 money[i]*3.8*10**5 sum type = [], [] [] type sum = 0 0 sum money, type = [], [] [] money m, t = input().split() input().split() m N = int(input()) int(input()) N t = input().split() input().split() t
N = int(input())
money, type = [], []
for i in range(N):
    m, t = input().split()
    money.append(float(m))
    type.append(t)

sum = 0
for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5
print(sum)