# coding: utf-8

num = int(input())
total = 0
for i in range(num):
    money, code = input().split()
    if code == "JPY":
        total += float(money)
    elif code == "BTC":
        total += float(money) * 380000.0
print(total) num = int(input()) num int(input()) int input() input total = 0 total 0 for i in range(num):
    money, code = input().split()
    if code == "JPY":
        total += float(money)
    elif code == "BTC":
        total += float(money) * 380000.0 i range(num) range num money, code = input().split() money input().split() ().split () input split code if code == "JPY":
        total += float(money)
    elif code == "BTC":
        total += float(money) * 380000.0 code == "JPY" code "JPY" total += float(money) total float(money) float money elif code == "BTC":
        total += float(money) * 380000.0 code == "BTC" code "BTC" total += float(money) * 380000.0 total float(money) * 380000.0 float(money) float money 380000.0 print(total) print total total += float(money) * 380000.0 float(money) * 380000.0 total code = input().split() input().split() code total += float(money) float(money) total money, code = input().split() input().split() money num = int(input()) int(input()) num total = 0 0 total
# coding: utf-8

num = int(input())
total = 0
for i in range(num):
    money, code = input().split()
    if code == "JPY":
        total += float(money)
    elif code == "BTC":
        total += float(money) * 380000.0
print(total)