import Foundation

let N = Int(readLine()!)!

var money = 0.0
for _ in 0..<N {
    let input = readLine()!.componentsSeparatedByString(" ")
    if input[1] == "JPY" {
        money += Double(input[0])!
    } else {
        money += Double(input[0])! * 380000.0
    }
}

print(money)