#! python3
#  solve_119_B.py

N = int(input())
money = 0

for i in range(N):
    value,money_type = map(str,input().split())
    if money_type == "JPY":
        money += int(value)
    elif money_type == "BTC":
        money += float(value) * 380000
        
print(money) N = int(input()) N int(input()) int input() input money = 0 money 0 for i in range(N):
    value,money_type = map(str,input().split())
    if money_type == "JPY":
        money += int(value)
    elif money_type == "BTC":
        money += float(value) * 380000
         i range(N) range N value,money_type = map(str,input().split()) value map(str,input().split()) map str input().split() ().split () input split money_type if money_type == "JPY":
        money += int(value)
    elif money_type == "BTC":
        money += float(value) * 380000
         money_type == "JPY" money_type "JPY" money += int(value) money int(value) int value elif money_type == "BTC":
        money += float(value) * 380000
         money_type == "BTC" money_type "BTC" money += float(value) * 380000 money float(value) * 380000 float(value) float value 380000 print(money) print money value,money_type = map(str,input().split()) map(str,input().split()) value money += int(value) int(value) money money += float(value) * 380000 float(value) * 380000 money money = 0 0 money N = int(input()) int(input()) N money_type = map(str,input().split()) map(str,input().split()) money_type
#! python3
#  solve_119_B.py

N = int(input())
money = 0

for i in range(N):
    value,money_type = map(str,input().split())
    if money_type == "JPY":
        money += int(value)
    elif money_type == "BTC":
        money += float(value) * 380000
        
print(money)