n=int(input())
s=0
for i in range(n):
    l=input().split()
    if(l[1]=='JPY'):
        s+=float(l[0])
    else:
        s+=float(l[0])*(380000)
print(s) n=int(input()) n int(input()) int input() input s=0 s 0 for i in range(n):
    l=input().split()
    if(l[1]=='JPY'):
        s+=float(l[0])
    else:
        s+=float(l[0])*(380000) i range(n) range n l=input().split() l input().split() ().split () input split if(l[1]=='JPY'):
        s+=float(l[0])
    else:
        s+=float(l[0])*(380000) l[1]=='JPY' l[1] l 1 'JPY' s+=float(l[0]) s float(l[0]) float l[0] l 0 s+=float(l[0])*(380000) s float(l[0])*(380000) float(l[0]) float l[0] l 0 380000 print(s) print s n=int(input()) int(input()) n s=0 0 s l=input().split() input().split() l s+=float(l[0])*(380000) float(l[0])*(380000) s s+=float(l[0]) float(l[0]) s
n=int(input())
s=0
for i in range(n):
    l=input().split()
    if(l[1]=='JPY'):
        s+=float(l[0])
    else:
        s+=float(l[0])*(380000)
print(s)
