import itertools
import math
import fractions
import functools

n = int(input())
dic = {"JPY":0, "BTC":0}
for i in range(n):
    l = list(input().split())
    if l[1] == 'JPY':
        dic["JPY"] += float(l[0])
    if l[1] == 'BTC':
        dic["BTC"] += float(l[0])

print(dic["JPY"] + 380000*dic["BTC"]) import itertools itertools import math math import fractions fractions import functools functools n = int(input()) n int(input()) int input() input dic = {"JPY":0, "BTC":0} dic {"JPY":0, "BTC":0} "JPY" "JPY" 0 "BTC" "BTC" 0 for i in range(n):
    l = list(input().split())
    if l[1] == 'JPY':
        dic["JPY"] += float(l[0])
    if l[1] == 'BTC':
        dic["BTC"] += float(l[0]) i range(n) range n l = list(input().split()) l list(input().split()) list input().split() ().split () input split if l[1] == 'JPY':
        dic["JPY"] += float(l[0])
     l[1] == 'JPY' l[1] l 1 'JPY' dic["JPY"] += float(l[0]) dic["JPY"] dic "JPY" float(l[0]) float l[0] l 0 if l[1] == 'BTC':
        dic["BTC"] += float(l[0]) l[1] == 'BTC' l[1] l 1 'BTC' dic["BTC"] += float(l[0]) dic["BTC"] dic "BTC" float(l[0]) float l[0] l 0 print(dic["JPY"] + 380000*dic["BTC"]) print dic["JPY"] + 380000*dic["BTC"] dic["JPY"] dic "JPY" 380000*dic["BTC"] 380000 dic["BTC"] dic "BTC" l = list(input().split()) list(input().split()) l n = int(input()) int(input()) n dic = {"JPY":0, "BTC":0} {"JPY":0, "BTC":0} dic
import itertools
import math
import fractions
import functools

n = int(input())
dic = {"JPY":0, "BTC":0}
for i in range(n):
    l = list(input().split())
    if l[1] == 'JPY':
        dic["JPY"] += float(l[0])
    if l[1] == 'BTC':
        dic["BTC"] += float(l[0])

print(dic["JPY"] + 380000*dic["BTC"])