Takahashi received otoshidama (New Year's money gifts) from N of his relatives.
You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.
For example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.
If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?

-----Constraints-----
 - 2 \leq N \leq 10
 - u_i = JPY or BTC.
 - If u_i = JPY, x_i is an integer such that 1 \leq x_i \leq 10^8.
 - If u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \leq x_i \leq 100.00000000.

-----Input-----
Input is given from Standard Input in the following format:
N
x_1 u_1
x_2 u_2
:
x_N u_N

-----Output-----
If the gifts are worth Y yen in total, print the value Y (not necessarily an integer).
Output will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.

-----Sample Input-----
2
10000 JPY
0.10000000 BTC

-----Sample Output-----
48000.0

The otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.
Outputs such as 48000 and 48000.1 will also be judged correct.

Difficulty: introductory

Starter code:

Solutions:
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    x[i], u[i] = list(map(str, input().split()))

ans = 0
for i in range(N):
    if u[i] == 'JPY':
        ans += float(x[i])
    else:
        ans += float(x[i]) * 380000

print(ans)


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


n=int(input())
x_list=[]
u_list=[]
for i in range(n):
  x,u=input().split()
  x_list.append(float(x))
  u_list.append(u)
sum=0
for i in range(n):
  if u_list[i]=="JPY":
    sum+=x_list[i]
  else:
    sum+=x_list[i]*380000.0
print(sum)

N = int(input())
btc_a = 380000.0
btc_b = btc_a / (10 ** 8)
ans = 0.0
for i in range(N):
  x, n = input().split()
  if n == "JPY":
    ans += int(x)
  else:
    a, b = map(int, x.split("."))
    ans += a * btc_a
    ans += b * btc_b
print(ans)

n = int(input())

ans = 0

for i in range(n):

    x,u = input().split()
    x = float(x)

    if(u=='BTC'):
        x *= 380000
    
    ans += x

print(ans)



n=int(input())
sum=0
for i in range(n):
    x,u=input().split()
    x=float(x)
    if u=='JPY':
        sum+=x
    else:
        sum+=x*380000
print(sum)

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


n=int(input())
kei = 0.0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        kei += float(x)
    else:
        kei += float(x)*380000.0
print(kei)

N = int(input())
ans=0
for _ in range(N):
    xu=input().split()
    if xu[1]=="JPY":
        ans+=int(xu[0])
    else:
        ans+=float(xu[0])*380000
print((ans+0.000001))


N=int(input())
list=[]
for i in range(N):
  a,b=input().split()
  list.append((float(a), b))
sum=0
for i in range(N):
  if list[i][1]=="JPY" :
    sum+=list[i][0]
  else :
    sum+=list[i][0]*380000
print(sum)

N = int(input())
X = []
U = []
for _ in range(N):
    x, u = input().split()
    X.append(float(x))
    U.append(u)

ans = 0
for x, u in zip(X, U):
    if u == 'JPY':
        ans += x
    else:
        ans += x*380000.
print(ans)


#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

n = int(input())
l = [list(map(str,input().split())) for i in range(n)]

ans = 0

for i in range(n):
    if l[i][1] == "JPY":
        ans += int(l[i][0])
    else:
        ans += float(l[i][0])*380000.0
print(ans)





n = int(input())
list = []
for i in range(n):
    a,b=input().split()
    list.append([float(a), b])
ans=0
for i in range(n):
    if(list[i][1]=='JPY'):
        ans+=list[i][0]
    else:
        ans+= 380000*list[i][0];
    
print(ans)


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


N=int(input())
s=0
for i in range(N):
    x,u=map(str,input().split())
    if u=='JPY':
        s+=int(x)
    else:
        s+=380000.0*float(x)
print(s)

n = int(input())
ans = 0
for _ in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'BTC':
        x *= 380000
    ans += x
print(ans)

N = int(input())
r = 380000
res = 0

for i in range(N):
    x, u = input().split()

    if u == 'JPY':
        res += int(x)
    else:
        res += float(x) * r

print(res)

# B Digital Gifts
N = int(input())
X = [list(map(str, input().split())) for _ in range(N)]
gifts = 0
for i in range(N):
    if X[i][1] == 'JPY':
        gifts += int(X[i][0])
    else:
        gifts += float(X[i][0]) * 380000
print(gifts)


n = int(input())
cnt = 0
for _ in range(n):
    x,u = map(str, input().split())
    if u == "JPY":
        cnt += float(x)
    else:
        cnt += float(x) * 380000.0
print(cnt)

n=int(input())
sm=0
for i in range(n):
    x,u=input().split()
    x=float(x)
    if u=="BTC":
        x*=380000.0
    sm+=x
print(sm)

n = int(input())
sum =0
for j in range(n):
  i,c = input().split()
  if c =="BTC":
    sum+=float(i)*380000
  else:
    sum+=int(i)
print(sum)

N = int(input())

ans = 0

for _ in range(N):
    x,u = input().split()
    x = float(x)
    if u == 'BTC':
        ans += 380000*x
    else:
        ans += x

print(ans)

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())
total = 0
for i in range(N):
    x, u = input().split()
    if u == 'JPY':
        total += int(x)
    else:
        total += float(x) * 380000
print(total)

n=int(input())
xu=[list(input().split()) for _ in range(n)]

result = 0
for i in range(n):
  if xu[i][1] == 'JPY':
    result += int(xu[i][0])
  else:
    result += float(xu[i][0]) * 380000
print(result)

n = int(input())
jpy = 0
btc = 0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jpy += int(a)
  else:
    btc += int(float(a) * 100000000)
print(jpy+(btc*38/10000))

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())

    ans = 0
    rate = 380000.0
    for _ in range(N):
        x, u = readline().split()
        if u == 'JPY':
            ans += int(x)
        else:
            ans += float(x) * rate

    print(ans)
    return


def __starting_point():
    main()

__starting_point()

n = int(input())

ans = 0
for i in range(n):
    x, u = input().split()

    if u == 'JPY':
        ans += float(x)
    else:
        ans += float(x) * 380000.0

print(ans)


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

n = int(input())
c = 0
for i in range(n):
  x,u = input().split()
  if u == "BTC":
    c += float(x)*380000
  else:
    c += int(x)
print(c)

def readinput():
    n=int(input())
    dama=[]
    for _ in range(n):
        a,b=input().split()
        dama.append((a,b))
    return n,dama

def main(n,dama):
    sum=0.0
    for x,u in dama:
        if u=='JPY':
            sum+=int(x)
        else:
            sum+=float(x)*380000.0
    return sum

def __starting_point():
    n,dama=readinput()
    ans=main(n,dama)
    print(ans)

__starting_point()

n = int(input())

ab = [list(input().split()) for _ in range(n)]
jpy =0
btc =0

for i in range(n):
    if ab[i][1] =="JPY":
        jpy += float(ab[i][0])
    
    elif ab[i][1] =="BTC":
        btc += float(ab[i][0])

print (jpy + btc *380000.0)

N = int(input())

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


n=int(input())

ans=0

for i in range(n):
    x,u=input().split()

    if(u=="JPY"):
        ans+=float(x)
    else:
        ans+=float(x)*380000

print(ans)


n = int(input()) 
y = 0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        y += int(x)
    if u == "BTC":
        y += 100000*float(x)/100000 * 380000.0
print(y)

n = int(input())
data = [input().split() for i in range(n)]
ans = 0
for i in range(n):
    if data[i][1] == 'JPY':
        ans += int(data[i][0])
    else:
        ans += float(data[i][0]) * 380000
print(ans)

n = int(input())
xu = [list(input().split()) for _ in range(n)]

money = 0

for k in xu:
    if k[1] == "JPY":
        money += float(k[0])
    else:
        money += float(k[0])*380000

print(money)

n=int(input())
x=[]
u=[]
yen=0
bit=0
for i in range(n):
    a,b=input().split()
    x.append(float(a))
    u.append(b)
for i in range(n):
    if u[i]=="JPY":
        yen+=x[i]
    else:
        bit+=x[i]
print(yen+380000*bit)

n = int(input())
a = 0
for i in range(n):
  v, c = input().split()
  v = float(v)
  if c == "JPY":
    a += v
  else:
    a += v * 380000.0
print(a)

# import numpy as np
# import math

# from scipy.special import perm : perm(n, r, exact=True)
# from scipy.special import comb : comb(n, r, exact=True)

# import itertools
# for v in itertools.combinations(L, n):M.append(list(v))

# from numba import njit
# @njit('f8(i8,i8,i8,i8,f8[:,:,:])', cache=True)


""" Definitions  """

def lcm(a, b):
    return a*b//math.gcd(a, b)

MOD = 10**9+7

# ============================================================

n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * 380000
print(ans)


N = int(input())
x = [0 for i in range(N)]
u = ['' for i in range(N)]
for i in range(N):
  x[i], u[i] = map(str, input().split())
  x[i] = float(x[i])

money = 0
for i in range(N):
  if u[i] == 'JPY':
    money += x[i]
  else:
    money += x[i] * 380000.0
print(money)

n = int(input())
a = 0
for _ in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        a += int(x)
    else:
        a += float(x) * 380000
print(a)

n = int(input())
ans = float(0)
for _ in range(n):
  m, u = input().split()
  m = float(m)
  if u == 'JPY':
    ans += m
  else:
    ans += m * float(380000)
print(ans)

n=int(input())
sum=0
for j in range(n):
  i,c=input().split()
  if c=="BTC":
    sum+=float(i)*380000
  else:
    sum+=int(i)
print(sum)

N = int(input())
ans = 0

for _ in range(N):
    x, u = input().split()

    if u == "JPY":
        ans += int(x)
    if u == "BTC":
        ans += float(x) * 380000.0

print(ans)

n=int(input())
ans=0
for i in range(n):
  x,u=map(str,input().split())
  x=float(x)
  if u == "JPY":
    ans += x
  else:
    ans += 380000*x
print(ans)

N = int(input())
j = 0
for i in range(N):
    x,u = map(str,input().split())
    x = float(x)
    if u == 'BTC':
        j += x*380000
    if u == 'JPY':
        j += x
print(j)

n = int(input())
ans = 0
for _ in range(n):
    x, u = input().split()
    if u == 'JPY':
        x = int(x)
        ans += x
    else:
        x = float(x)
        tmp = x*380000
        ans += tmp

print(ans)

n=int(input())
ans=0
for i in range(n):
  a,b=map(str, input().split())
  if b=='JPY':
    ans+=float(a)
  else:
    ans+=float(a)*380000
print(ans)

n = int(input())
btc = 380000.0
a = 0
for _ in range(n):
    x, u = input().split()
    if u == 'JPY':
        a += int(x)
    elif u == 'BTC':
        a += float(x)*btc
print(a)


N = int(input())
m = []
for i in range(N):
  x, u = input().split(" ")
  if u == 'JPY':
    m.append(int(x))
  elif u == 'BTC':
    m.append(float(x) * 380000)

print(sum(m))

bit = 380000.0

n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * bit
print(ans)

N = int(input())

result = 0

for _ in range(N):
  x, u = input().split()
  x = float(x)
  
  if u == "JPY":
    result += x
  else:
    result += x * (3.8 * 10 ** 5)
    
print(result)

N = int(input())
otoshidama = 0
for i in range(N):
    x,u = input().split()

    if u =='JPY':
        otoshidama += int(x)
    else:
        otoshidama += float(x)*380000

print(otoshidama)

def mapt(fn, *args):
    return tuple(map(fn, *args))
  

def Vector(line):
    return mapt(Atom, line.split(" "))


def Atom(segment):
    try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment

def main():
    n = int(input())
    data = [Vector(input()) for _ in range(n)]
    total = 0
    for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
    print(total)

main()

from typing import List, Tuple


def answer(n: int, xus: List[Tuple[float, str]]) -> float:
    otoshidama = 0
    for x, u in xus:
        if u == 'BTC':
            otoshidama += x * 380000.0
        else:
            otoshidama += x
            
    return otoshidama


def main():
    n = int(input())
    xus = []
    for i in range(n):
        x, u = input().split()
        xus.append((float(x), u))

    print(answer(n, xus))


def __starting_point():
    main()
__starting_point()

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

JPY = 1
BTC = 380000
n = int(input())
ans = 0
for i in range(n):
    x,u = map(str,input().split())
    if u == 'BTC':
        tmp = float(x) * BTC
    else:
        tmp = int(x) * JPY
    ans += tmp
print(ans)

N = int(input())

ans = 0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == 'BTC':
        ans += 380000.0*x
    elif u == 'JPY':
        ans += x

print(ans)


n = int(input())
li = [list(input().split()) for i in range(n)]
total = 0

for i in range(n):
    if li[i][1] == 'JPY':
        total += float(li[i][0])
    else:
        total += float(li[i][0])*380000.0

print(total)

N = int(input())
ans = 0
for i in range(N):
  x, u = map(str, input().split())
  if u == 'JPY':
    ans += int(x)
  else:
    ans += float(x) * 380000
print(ans)


N = int(input())
ans = 0

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

print(ans)

n=int(input())
jpy=btc=0
for i in range(n):
    x,u = map(str,input().split())
    if u=="JPY":
        jpy+=int(x)
    else:
        btc+=float(x)

ans = jpy+380000.0*btc
print(ans)

n=int(input())
ans=0
for i in range(n):
    x,u=input().split()
    x=float(x)
    if u=="BTC":
        ans += x*380000.0
    else:
        ans += x
print(ans)

n = int(input())
total = 0
for i in range(n):
    value, currency = input().split()
    if currency == 'JPY':
        total += float(value)
    else:
        total += float(value) * 380000
print(total)

n = int(input())
ans = 0
for i in range(n):
  x,u = input().split()
  if u == "JPY":
    ans += int(x)
  else:
    ans += float(x)* 380000.0
print(ans)

n=int(input())

s=0

for i in range(n):
    a,u=input().split()
    if u=="JPY":
        s+=int(a)
    else:
        s+=float(a)* 380000
        
print(s)


n = int(input())
list_bonus = [[s for s in input().split()] for j in range(0, n)]
ans = 0.0
for i in range(0, n):
    if list_bonus[i][1] == "JPY":
        ans += float(list_bonus[i][0])
    else:
        ans += float(list_bonus[i][0]) * 380000.0
print(ans)

n = int(input())

j, b = 0, 0
for _ in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        j += x
    else:
        b += x
print(j + b*380000)

n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        ans += x
    else:
        ans += x*380000
print(ans)

n=int(input())
m=[list(map(str,input().split())) for i in range(n)]

cnt=0

for i in range(n):
  m[i][0]=float(m[i][0])
  if m[i][1]=='BTC':
    m[i][0]*=380000.0
  cnt+=m[i][0]

print(cnt)

N = int(input())

ans = 0.0
r = 380000.0
for i in range(N):
  x, u = input().split()
  x = float(x)
  if u == 'JPY': ans += x
  if u == 'BTC': ans += r * float(x)
    
print(ans)

N = int(input())
ans = 0
for i in range(N):
    x,u = map(str,input().split())
    if(u == "JPY"):
        ans += int(x)
    else:
        x = x.replace(".","")
        ans += (int(x) * 380000 / 10**8)
print(str(ans))

n = int(input())
num = 0
for i in range(n):
    x1,v1 = map(str, input().split())
    if v1 == 'JPY':
        num += int(x1)
    else:
        num += float(x1)*380000
print(num)

n = int(input())

money_sum = 0

for i in range(n):
    x,u = input().split()
    x = float(x)
    if u == "JPY":
        money_sum += x
    else:
        money_sum += x*380000
print(money_sum)

import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return list(map(int, stdin.readline().split()))
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    m = [tuple(input().split()) for _ in range(n)]
    btc_to_jpy = 380000
    ans = 0
    for price, kind in m:
        if kind == 'JPY':
            ans += int(price)
        else:
            ans += btc_to_jpy * float(price)
    print(ans)


def __starting_point():
    main()

__starting_point()

N = int(input())

# やるだけ
ans = 0.0
for i in range(N):
  x, u = input().split()
  x = float(x)
  if u == 'JPY': ans += x
  if u == 'BTC': ans += 380000.0 * x
    
print(ans)

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)

a=int(input())
b=[input().split() for i in range(a)]
c=0
for i in range(a):
  if b[i][1]=="JPY":
    c=c+int(b[i][0])
  if b[i][1]=="BTC":
    c=c+float(b[i][0])*380000
print(c)

n = int(input())
res = 0.0
for _ in range(n):
    x, u = input().split()
    x = float(x)
    res += x if u == 'JPY' else x * 380000.0
print(res)


def resolve():
    n = int(input())
    s = 0
    for _ in range(n):
        x, u = input().split()
        if u == 'BTC':
            s += float(x) * 380000
        else:
            s += float(x) * 1
    print(s)
resolve()

N = int(input())

ans = 0
for i in range(N):
    x, u = map(str,input().split())
    x = float(x)

    if u == "JPY":
        ans += x
    else:
        ans += x * 380000.0

print(ans)

n = int(input())
ans = 0.0
rate = 380000.0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    ans += float(a)
  else:
    ans += (float(a)*rate)
print(ans)

n = int(input())
c = 0
for i in range(n):
    y, t = input().split()
    if t == 'BTC':
        yen = float(y)*380000.0
    else:
        yen = float(y)
    c += yen

print(c)

N=int(input())
xu=[]
for i in range(N):
    xu.append(list(map(str,input().split())))
a=0
for i in range(N):
    if xu[i][1]=='JPY':
        a+=float(xu[i][0])
    if xu[i][1]=='BTC':
        a+=float(xu[i][0])*(380000.0)
print(a)

N = int(input())
total = 0
for i in range(N):
    x,u = map(str,input().split())
    if u == 'JPY':
        total += int(x)
    else:
        total += float(x) * 380000.0
print(total)

N = int(input())
moneys = [tuple(map(str, input().split())) for _ in range(N)]
rate = 380000

total = 0
for money in moneys:
    x, u = money
    x = float(x)
    if u == 'JPY':
        total += x
    else:
        total += x * rate

print(total)



N = int(input())
b_to_y = 380000
ans = 0
for i in range(N):
  p, unit = input().split()
  if unit == "JPY":
    ans += int(p)
  if unit == "BTC":
    ans += (b_to_y * float(p))
print(ans)

n=int(input())
ans=0
for _ in range(n):
  v,t=input().split()
  if t=='JPY':
    ans += int(v)
  else:
    ans += float(v)*380000
print(ans)

n = int(input())
a = [list(input().split()) for _ in range(n)]

ans = 0

for i in range(n):
    if a[i][1] == 'BTC':
        ans += float(a[i][0]) * 380000
    else:
        ans += float(a[i][0])

print(ans)

N=int(input())
l=[0]*N 
 
for i in range(N):
	x,y=map(str,input().split())
	l[i] = float(x)
	if y == "BTC":
		 l[i] *= 380000.0

ans = sum(l)
print(ans)

N=int(input())
ans=0
for i in range(N):
	x,u=map(str, input().split())
	if u=="BTC":
		ans+=float(x)*380000
	else:
		ans+=float(x)
	#print(ans)

print(ans)

n = int(input())
x=[]
for i in range(n):
  a,b = input().split()
  if b == 'JPY':
    x.append(int(a))
  else:
    x.append(float(a)*380000)
print(sum(x))

n = int(input())
btc = 380000.0
a = 0
# 単位毎に加算する。
for _ in range(n):
    x, u = input().split()
    if u == 'JPY':
        a += int(x)
    elif u == 'BTC':
        a += float(x)*btc
print(a)


import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    xu = [LSS() for _ in range(N)]

    ans = 0
    for x, u in xu:
        if u == 'JPY':
            ans += int(x)
        else:
            ans += float(x) * 380000

    print(ans)

def __starting_point():
    resolve()

__starting_point()

n=int(input())
ans=0
for i in range(n):
    a,b=input().split()
    if b=="JPY":
        ans+=int(a)
    else:
        ans+=float(a)*380000.0

print(ans)

n=int(input())
J,B=0,0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        J+=int(x)
    else:
        B+=float(x)

ans=J+B*380000
print(ans)

import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n, = [int(num) for num in lines.pop(0).split(" ")]
def iter_value_and_unit():
    for line in lines:
        value, unit = line.split(" ")
        value = float(value)
        if unit == "BTC":
            yield 380000.0 * value
        else:
            yield value

print((sum(iter_value_and_unit())))


# coding: utf-8

num = int(input())
total = 0
for i in range(num):
    money, code = input().split()
    if code == "JPY":
        total += float(money)
    elif code == "BTC":
        total += float(money) * 380000.0
print(total)

n = int(input())
xu = [list(input().split()) for i in range(n)]
ans = 0
for i in range(n) :
    xu[i][0] = float(xu[i][0])
    if xu[i][1] == "JPY" :
        ans += xu[i][0]

    else :
        ans += xu[i][0]*380000

print(ans)