N = int(input())

JPY = 0
BTC = 0
for i in range(N):
	a, b = input().split()
	if b == 'JPY':
		JPY += float(a)
	else:
		BTC += float(a)
print(JPY + 380000.0 * BTC) N = int(input()) N int(input()) int input() input JPY = 0 JPY 0 BTC = 0 BTC 0 for i in range(N):
	a, b = input().split()
	if b == 'JPY':
		JPY += float(a)
	else:
		BTC += float(a) i range(N) range N a, b = input().split() a input().split() ().split () input split b if b == 'JPY':
		JPY += float(a)
	else:
		BTC += float(a) b == 'JPY' b 'JPY' JPY += float(a) JPY float(a) float a BTC += float(a) BTC float(a) float a print(JPY + 380000.0 * BTC) print JPY + 380000.0 * BTC JPY 380000.0 * BTC 380000.0 BTC BTC = 0 0 BTC a, b = input().split() input().split() a N = int(input()) int(input()) N JPY += float(a) float(a) JPY b = input().split() input().split() b BTC += float(a) float(a) BTC JPY = 0 0 JPY
N = int(input())

JPY = 0
BTC = 0
for i in range(N):
	a, b = input().split()
	if b == 'JPY':
		JPY += float(a)
	else:
		BTC += float(a)
print(JPY + 380000.0 * BTC)