N = int(eval(input()))

btc = 380000

money = 0

for _ in range(N):

  x, u = input().split()

  if(u == "JPY"):

    money += int(x)

  else:

    money += float(x)*btc

print(money)
import sys 

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()

ni = lambda : int(ns())



n = ni()

btc = 380000

ans = 0

for _ in range(n):

  a, b = ns().split()

  if b == "BTC":

    ans += float(a) * btc

  else:

    ans += int(a)

print(ans)

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

import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
n = ni()
btc = 380000
ans = 0
for _ in range(n):
    a, b = ns().split()
    if b == "BTC":
        ans += float(a) * btc
    else:
        ans += int(a)
print(ans)

-N = int(eval(input())) +import sys + +stdin = sys.stdin +ns = lambda: stdin.readline().rstrip() +ni = lambda: int(ns()) +n = ni() -money = 0 -for _ in range(N): -    x, u = input().split() -    if u == "JPY": -        money += int(x) +ans = 0 +for _ in range(n): +    a, b = ns().split() +    if b == "BTC": +        ans += float(a) * btc -        money += float(x) * btc -print(money) +        ans += int(a) +print(ans)