n = int(input()) 
y = 0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        y += int(x)
    if u == "BTC":
        y += 100000*float(x)/100000 * 380000.0
print(y) n = int(input()) n int(input()) int input() input y = 0 y 0 for i in range(n):
    x, u = input().split()
    if u == "JPY":
        y += int(x)
    if u == "BTC":
        y += 100000*float(x)/100000 * 380000.0 i range(n) range n x, u = input().split() x input().split() ().split () input split u if u == "JPY":
        y += int(x)
     u == "JPY" u "JPY" y += int(x) y int(x) int x if u == "BTC":
        y += 100000*float(x)/100000 * 380000.0 u == "BTC" u "BTC" y += 100000*float(x)/100000 * 380000.0 y 100000*float(x)/100000 * 380000.0 100000*float(x)/100000 100000*float(x) 100000 float(x) float x 100000 380000.0 print(y) print y n = int(input()) int(input()) n y = 0 0 y y += int(x) int(x) y y += 100000*float(x)/100000 * 380000.0 100000*float(x)/100000 * 380000.0 y u = input().split() input().split() u x, u = input().split() input().split() x
n = int(input()) 
y = 0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        y += int(x)
    if u == "BTC":
        y += 100000*float(x)/100000 * 380000.0
print(y)