n = int(input())
ansj = 0
ansb = 0
for i in range(n):
    x,u = input().split()
    if u == "JPY":
        ansj += int(x)
    else:
        ansb += float(x)
ansb*=380000
ansj = float(ansj)
print(ansj+ansb) n = int(input()) n int(input()) int input() input ansj = 0 ansj 0 ansb = 0 ansb 0 for i in range(n):
    x,u = input().split()
    if u == "JPY":
        ansj += int(x)
    else:
        ansb += float(x) i range(n) range n x,u = input().split() x input().split() ().split () input split u if u == "JPY":
        ansj += int(x)
    else:
        ansb += float(x) u == "JPY" u "JPY" ansj += int(x) ansj int(x) int x ansb += float(x) ansb float(x) float x ansb*=380000 ansb 380000 ansj = float(ansj) ansj float(ansj) float ansj print(ansj+ansb) print ansj+ansb ansj ansb u = input().split() input().split() u n = int(input()) int(input()) n ansj += int(x) int(x) ansj ansb*=380000 380000 ansb ansb = 0 0 ansb ansj = 0 0 ansj x,u = input().split() input().split() x ansb += float(x) float(x) ansb ansj = float(ansj) float(ansj) ansj
n = int(input())
ansj = 0
ansb = 0
for i in range(n):
    x,u = input().split()
    if u == "JPY":
        ansj += int(x)
    else:
        ansb += float(x)
ansb*=380000
ansj = float(ansj)
print(ansj+ansb)