n = int(input())
list = []
for i in range(n):
    a,b=input().split()
    list.append([float(a), b])
ans=0
for i in range(n):
    if(list[i][1]=='JPY'):
        ans+=list[i][0]
    else:
        ans+= 380000*list[i][0];
    
print(ans) n = int(input()) n int(input()) int input() input list = [] list [] for i in range(n):
    a,b=input().split()
    list.append([float(a), b]) i range(n) range n a,b=input().split() a input().split() ().split () input split b list.append([float(a), b]) list.append list append [float(a), b] float(a) float a b ans=0 ans 0 for i in range(n):
    if(list[i][1]=='JPY'):
        ans+=list[i][0]
    else:
        ans+= 380000*list[i][0];
     i range(n) range n if(list[i][1]=='JPY'):
        ans+=list[i][0]
    else:
        ans+= 380000*list[i][0];
     list[i][1]=='JPY' list[i][1] [i] list i 1 'JPY' ans+=list[i][0] ans list[i][0] [i] list i 0 ans+= 380000*list[i][0] ans 380000*list[i][0] 380000 list[i][0] [i] list i 0 print(ans) print ans ans=0 0 ans list = [] [] list a,b=input().split() input().split() a n = int(input()) int(input()) n ans+=list[i][0] list[i][0] ans b=input().split() input().split() b ans+= 380000*list[i][0] 380000*list[i][0] ans
n = int(input())
list = []
for i in range(n):
    a,b=input().split()
    list.append([float(a), b])
ans=0
for i in range(n):
    if(list[i][1]=='JPY'):
        ans+=list[i][0]
    else:
        ans+= 380000*list[i][0];
    
print(ans)
