N = int(input())
X = []
U = []
result = []
for _ in range(N):
    x, u = input().split()
    X.append(float(x))
    U.append(u)
   


for a, b in zip(X, U):
    if b == "BTC":
        result.append(380000 * a)
    else:
        result.append(a)

print(sum(result)) N = int(input()) N int(input()) int input() input X = [] X [] U = [] U [] result = [] result [] for _ in range(N):
    x, u = input().split()
    X.append(float(x))
    U.append(u)
    _ range(N) range N x, u = input().split() x input().split() ().split () input split u X.append(float(x)) X.append X append float(x) float x U.append(u) U.append U append u for a, b in zip(X, U):
    if b == "BTC":
        result.append(380000 * a)
    else:
        result.append(a) a b zip(X, U) zip X U if b == "BTC":
        result.append(380000 * a)
    else:
        result.append(a) b == "BTC" b "BTC" result.append(380000 * a) result.append result append 380000 * a 380000 a result.append(a) result.append result append a print(sum(result)) print sum(result) sum result N = int(input()) int(input()) N U = [] [] U result = [] [] result u = input().split() input().split() u X = [] [] X x, u = input().split() input().split() x
N = int(input())
X = []
U = []
result = []
for _ in range(N):
    x, u = input().split()
    X.append(float(x))
    U.append(u)
   


for a, b in zip(X, U):
    if b == "BTC":
        result.append(380000 * a)
    else:
        result.append(a)

print(sum(result))
