n = int(input())
gifts = []
for i in range(n):
    gift = input().split()
    gifts.append(gift)
ans = 0
for j in range(n):
    if gifts[j][1] == "BTC":
        price = float(gifts[j][0]) * 380000
        ans += price
    elif gifts[j][1] == "JPY":
        price = float(gifts[j][0])
        ans += price
print(ans) n = int(input()) n int(input()) int input() input gifts = [] gifts [] for i in range(n):
    gift = input().split()
    gifts.append(gift) i range(n) range n gift = input().split() gift input().split() ().split () input split gifts.append(gift) gifts.append gifts append gift ans = 0 ans 0 for j in range(n):
    if gifts[j][1] == "BTC":
        price = float(gifts[j][0]) * 380000
        ans += price
    elif gifts[j][1] == "JPY":
        price = float(gifts[j][0])
        ans += price j range(n) range n if gifts[j][1] == "BTC":
        price = float(gifts[j][0]) * 380000
        ans += price
    elif gifts[j][1] == "JPY":
        price = float(gifts[j][0])
        ans += price gifts[j][1] == "BTC" gifts[j][1] [j] gifts j 1 "BTC" price = float(gifts[j][0]) * 380000 price float(gifts[j][0]) * 380000 float(gifts[j][0]) float gifts[j][0] [j] gifts j 0 380000 ans += price ans price elif gifts[j][1] == "JPY":
        price = float(gifts[j][0])
        ans += price gifts[j][1] == "JPY" gifts[j][1] [j] gifts j 1 "JPY" price = float(gifts[j][0]) price float(gifts[j][0]) float gifts[j][0] [j] gifts j 0 ans += price ans price print(ans) print ans price = float(gifts[j][0]) * 380000 float(gifts[j][0]) * 380000 price gift = input().split() input().split() gift price = float(gifts[j][0]) float(gifts[j][0]) price ans = 0 0 ans n = int(input()) int(input()) n ans += price price ans ans += price price ans gifts = [] [] gifts
n = int(input())
gifts = []
for i in range(n):
    gift = input().split()
    gifts.append(gift)
ans = 0
for j in range(n):
    if gifts[j][1] == "BTC":
        price = float(gifts[j][0]) * 380000
        ans += price
    elif gifts[j][1] == "JPY":
        price = float(gifts[j][0])
        ans += price
print(ans)