import Data.List
import Control.Monad

g :: [String] -> Float
g = read.head.words.head

f :: [String] -> Float -> Float
f l x = if null l then x else if(((last.words.head) l)=="JPY")then f (tail l) (x+(g l)) else f (tail l) (x+(g l)*380000.0)

main=do
 n<-readLn
 l<-replicateM n getLine
 print$f l 0