N = int(input())

jpy = 0
btc = 0

for _ in range(N):
  x,u = input().split()
  if u == "JPY":
    jpy += int(x)
  else:
    btc += float(x)
    
print(jpy + btc*380000) N = int(input()) N int(input()) int input() input jpy = 0 jpy 0 btc = 0 btc 0 for _ in range(N):
  x,u = input().split()
  if u == "JPY":
    jpy += int(x)
  else:
    btc += float(x)
     _ range(N) range N x,u = input().split() x input().split() ().split () input split u if u == "JPY":
    jpy += int(x)
  else:
    btc += float(x)
     u == "JPY" u "JPY" jpy += int(x) jpy int(x) int x btc += float(x) btc float(x) float x print(jpy + btc*380000) print jpy + btc*380000 jpy btc*380000 btc 380000 jpy += int(x) int(x) jpy jpy = 0 0 jpy u = input().split() input().split() u N = int(input()) int(input()) N btc = 0 0 btc x,u = input().split() input().split() x btc += float(x) float(x) btc
N = int(input())

jpy = 0
btc = 0

for _ in range(N):
  x,u = input().split()
  if u == "JPY":
    jpy += int(x)
  else:
    btc += float(x)
    
print(jpy + btc*380000)