n = int(raw_input())
q= 0 
for _ in range(n):
	u,v = raw_input().split(' ')
	u = float(u)
	h = {'BTC':380000.0, 'JPY':1.0}
	q += u * h[v]
print q n = int(raw_input()) n int(raw_input()) int raw_input() raw_input q= 0 q 0 for _ in range(n):
	u,v = raw_input().split(' ')
	u = float(u)
	h = {'BTC':380000.0, 'JPY':1.0}
	q += u * h[v] _ range(n) range n u,v = raw_input().split(' ') u raw_input().split(' ') ().split () raw_input split ' ' v u = float(u) u float(u) float u h = {'BTC':380000.0, 'JPY':1.0} h {'BTC':380000.0, 'JPY':1.0} 'BTC' 'BTC' 380000.0 'JPY' 'JPY' 1.0 q += u * h[v] q u * h[v] u h[v] h v print q= 0 0 q n = int(raw_input()) int(raw_input()) n u = float(u) float(u) u u,v = raw_input().split(' ') raw_input().split(' ') u h = {'BTC':380000.0, 'JPY':1.0} {'BTC':380000.0, 'JPY':1.0} h v = raw_input().split(' ') raw_input().split(' ') v q += u * h[v] u * h[v] q
n = int(raw_input())
q= 0 
for _ in range(n):
	u,v = raw_input().split(' ')
	u = float(u)
	h = {'BTC':380000.0, 'JPY':1.0}
	q += u * h[v]
print q
