N = int(input())

ans = 0
for i in range(N):
    X, U = map(str, input().split())
    if U == 'BTC':
        X = float(X)*380000
    ans += float(X)

print(ans) N = int(input()) N int(input()) int input() input ans = 0 ans 0 for i in range(N):
    X, U = map(str, input().split())
    if U == 'BTC':
        X = float(X)*380000
    ans += float(X) 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 == 'BTC':
        X = float(X)*380000
     U == 'BTC' U 'BTC' X = float(X)*380000 X float(X)*380000 float(X) float X 380000 ans += float(X) ans float(X) float X print(ans) print ans ans = 0 0 ans U = map(str, input().split()) map(str, input().split()) U N = int(input()) int(input()) N X = float(X)*380000 float(X)*380000 X X, U = map(str, input().split()) map(str, input().split()) X ans += float(X) float(X) ans
N = int(input())

ans = 0
for i in range(N):
    X, U = map(str, input().split())
    if U == 'BTC':
        X = float(X)*380000
    ans += float(X)

print(ans)