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