
f [x,y] = (x,y)

btoy b = b * 380000
toy :: (String,String) -> Float
toy (y,"JPY") = read y
toy (b,"BTC") = btoy $ read b

main = do
  getLine
  ys <- map (f.words) . lines <$> getContents
  print $ sum $ map toy ys
