n = int(input())
ans = 0
for i in range(n):
    x,v = input().split()
    if v == "JPY":
        ans += int(x)
    elif v == "BTC":
        ans += float(x)*380000.0
print(ans) n = int(input()) n int(input()) int input() input ans = 0 ans 0 for i in range(n):
    x,v = input().split()
    if v == "JPY":
        ans += int(x)
    elif v == "BTC":
        ans += float(x)*380000.0 i range(n) range n x,v = input().split() x input().split() ().split () input split v if v == "JPY":
        ans += int(x)
    elif v == "BTC":
        ans += float(x)*380000.0 v == "JPY" v "JPY" ans += int(x) ans int(x) int x elif v == "BTC":
        ans += float(x)*380000.0 v == "BTC" v "BTC" ans += float(x)*380000.0 ans float(x)*380000.0 float(x) float x 380000.0 print(ans) print ans n = int(input()) int(input()) n ans = 0 0 ans ans += float(x)*380000.0 float(x)*380000.0 ans x,v = input().split() input().split() x v = input().split() input().split() v ans += int(x) int(x) ans
n = int(input())
ans = 0
for i in range(n):
    x,v = input().split()
    if v == "JPY":
        ans += int(x)
    elif v == "BTC":
        ans += float(x)*380000.0
print(ans)