s = 0
for i in range(int(input())):
    x, u = input().split()
    if u=='BTC':
        s += float(x)*38*(10**4)
    else:
        s += int(x)
print(s) s = 0 s 0 for i in range(int(input())):
    x, u = input().split()
    if u=='BTC':
        s += float(x)*38*(10**4)
    else:
        s += int(x) i range(int(input())) range int(input()) int input() input x, u = input().split() x input().split() ().split () input split u if u=='BTC':
        s += float(x)*38*(10**4)
    else:
        s += int(x) u=='BTC' u 'BTC' s += float(x)*38*(10**4) s float(x)*38*(10**4) float(x)*38 float(x) float x 38 10**4 10 4 s += int(x) s int(x) int x print(s) print s x, u = input().split() input().split() x s += float(x)*38*(10**4) float(x)*38*(10**4) s s += int(x) int(x) s s = 0 0 s u = input().split() input().split() u
s = 0
for i in range(int(input())):
    x, u = input().split()
    if u=='BTC':
        s += float(x)*38*(10**4)
    else:
        s += int(x)
print(s)