cost = 0
n = int(input())
for _ in [0] * n:
    s = input().split()
    x, u = float(s[0]), s[1]
    if u == "BTC":
        cost += x * 38e4
    else:
        cost += x
print(cost) cost = 0 cost 0 n = int(input()) n int(input()) int input() input for _ in [0] * n:
    s = input().split()
    x, u = float(s[0]), s[1]
    if u == "BTC":
        cost += x * 38e4
    else:
        cost += x _ [0] * n [0] 0 n s = input().split() s input().split() ().split () input split x, u = float(s[0]), s[1] x float(s[0]) float s[0] s 0 u s[1] s 1 if u == "BTC":
        cost += x * 38e4
    else:
        cost += x u == "BTC" u "BTC" cost += x * 38e4 cost x * 38e4 x 38e4 cost += x cost x print(cost) print cost s = input().split() input().split() s u = float(s[0]), s[1] s[1] u cost = 0 0 cost n = int(input()) int(input()) n x, u = float(s[0]), s[1] float(s[0]) x cost += x x cost cost += x * 38e4 x * 38e4 cost
cost = 0
n = int(input())
for _ in [0] * n:
    s = input().split()
    x, u = float(s[0]), s[1]
    if u == "BTC":
        cost += x * 38e4
    else:
        cost += x
print(cost)