read N
ans=0
for ((i=0; i<N; i++)); do
    read x y
    if [[ $y == 'JPY' ]]; then
        ans=$(echo "$ans + $x" | bc)
    else
        ans=$(echo "$ans + $x * 380000" | bc)
    fi
done

printf "%.6f" $ans
