a=int(input())
b=[input().split() for i in range(a)]
c=0
for i in range(a):
  if b[i][1]=="JPY":
    c=c+int(b[i][0])
  if b[i][1]=="BTC":
    c=c+float(b[i][0])*380000
print(c) a=int(input()) a int(input()) int input() input input().split() for i in range(a) for i in range(a) i range(a) range a for i in range(a) input().split() ().split () input split b=[input().split() for i in range(a)] b [input().split() for i in range(a)] c=0 c 0 for i in range(a):
  if b[i][1]=="JPY":
    c=c+int(b[i][0])
  if b[i][1]=="BTC":
    c=c+float(b[i][0])*380000 i range(a) range a if b[i][1]=="JPY":
    c=c+int(b[i][0])
   b[i][1]=="JPY" b[i][1] [i] b i 1 "JPY" c=c+int(b[i][0]) c c+int(b[i][0]) c int(b[i][0]) int b[i][0] [i] b i 0 if b[i][1]=="BTC":
    c=c+float(b[i][0])*380000 b[i][1]=="BTC" b[i][1] [i] b i 1 "BTC" c=c+float(b[i][0])*380000 c c+float(b[i][0])*380000 c float(b[i][0])*380000 float(b[i][0]) float b[i][0] [i] b i 0 380000 print(c) print c a=int(input()) int(input()) a b=[input().split() for i in range(a)] [input().split() for i in range(a)] b c=c+float(b[i][0])*380000 c+float(b[i][0])*380000 c c=c+int(b[i][0]) c+int(b[i][0]) c c=0 0 c
a=int(input())
b=[input().split() for i in range(a)]
c=0
for i in range(a):
  if b[i][1]=="JPY":
    c=c+int(b[i][0])
  if b[i][1]=="BTC":
    c=c+float(b[i][0])*380000
print(c)