N = int(input())
money = [input().split() for i in range(N)]

JPY = [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY']
BTC = [float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC']

print(sum(JPY) + sum(BTC)) N = int(input()) N int(input()) int input() input input().split() for i in range(N) for i in range(N) i range(N) range N for i in range(N) input().split() ().split () input split money = [input().split() for i in range(N)] money [input().split() for i in range(N)] int(money[i][0]) for i in range(N) if money[i][1] == 'JPY' for i in range(N) if money[i][1] == 'JPY' i range(N) range N money[i][1] == 'JPY' money[i][1] [i] money i 1 'JPY' if money[i][1] == 'JPY' int(money[i][0]) int money[i][0] [i] money i 0 JPY = [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY'] JPY [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY'] float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC' for i in range(N) if money[i][1] == 'BTC' i range(N) range N money[i][1] == 'BTC' money[i][1] [i] money i 1 'BTC' if money[i][1] == 'BTC' float(money[i][0]) * 380000 float(money[i][0]) float money[i][0] [i] money i 0 380000 BTC = [float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC'] BTC [float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC'] print(sum(JPY) + sum(BTC)) print sum(JPY) + sum(BTC) sum(JPY) sum JPY sum(BTC) sum BTC money = [input().split() for i in range(N)] [input().split() for i in range(N)] money N = int(input()) int(input()) N JPY = [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY'] [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY'] JPY BTC = [float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC'] [float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC'] BTC
N = int(input())
money = [input().split() for i in range(N)]

JPY = [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY']
BTC = [float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC']

print(sum(JPY) + sum(BTC))