N = int(input())
res = 0
for i in range(N):
    x,u = map(str, input().split())
    if u == "JPY":
        res += int(x)
    else:
        res += float(x)*380000
print(res) N = int(input()) N int(input()) int input() input res = 0 res 0 for i in range(N):
    x,u = map(str, input().split())
    if u == "JPY":
        res += int(x)
    else:
        res += float(x)*380000 i range(N) range N x,u = map(str, input().split()) x map(str, input().split()) map str input().split() ().split () input split u if u == "JPY":
        res += int(x)
    else:
        res += float(x)*380000 u == "JPY" u "JPY" res += int(x) res int(x) int x res += float(x)*380000 res float(x)*380000 float(x) float x 380000 print(res) print res u = map(str, input().split()) map(str, input().split()) u res = 0 0 res res += int(x) int(x) res N = int(input()) int(input()) N res += float(x)*380000 float(x)*380000 res x,u = map(str, input().split()) map(str, input().split()) x
N = int(input())
res = 0
for i in range(N):
    x,u = map(str, input().split())
    if u == "JPY":
        res += int(x)
    else:
        res += float(x)*380000
print(res)