n = int(input())
yt = 0
bt = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        yt += x
    else:
        bt += x

ans = yt + bt*380000
print(ans) n = int(input()) n int(input()) int input() input yt = 0 yt 0 bt = 0 bt 0 for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        yt += x
    else:
        bt += x i range(n) range n x, u = input().split() x input().split() ().split () input split u x = float(x) x float(x) float x if u == 'JPY':
        yt += x
    else:
        bt += x u == 'JPY' u 'JPY' yt += x yt x bt += x bt x ans = yt + bt*380000 ans yt + bt*380000 yt bt*380000 bt 380000 print(ans) print ans n = int(input()) int(input()) n u = input().split() input().split() u ans = yt + bt*380000 yt + bt*380000 ans x, u = input().split() input().split() x yt = 0 0 yt bt = 0 0 bt x = float(x) float(x) x bt += x x bt yt += x x yt
n = int(input())
yt = 0
bt = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        yt += x
    else:
        bt += x

ans = yt + bt*380000
print(ans)