function frac(){
    readonly mul=100000
    readonly mullen=${#mul}
    local a=$1
    local b=$2
    local tmp=`printf "%0${mullen}d" $((a*mul/b))`
    local tmplen=${#tmp}
    local ilen=$((tmplen-(mullen-1)))
    local flen=$((mullen-1))
    echo ${tmp:0:$ilen}"."${tmp: -$flen}
}
read n
s=0
for i in `seq $n`
do
    read x u
    case $u in
        "JPY")
            s=$((s+x*10000));;
        "BTC")
            x=`echo $x | tr -d \. | sed -r "s/^0+//"`
            s=$((s+x*38))
    esac
done
frac $s 10000