Problem:
 Score : 200 points    Problem Statement 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 1 2
10000 JPY
0.10000000 BTC      Sample Output 1 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.       Sample Input 2 3
100000000 JPY
100.00000000 BTC
0.00000001 BTC      Sample Output 2 138000000.0038  In this case, outputs such as 138001000 and 1.38e8 will also be judged correct.

Solution (Python):
import numpy as np
people_num = int(input())

otoshidama_box = []

for i in range(people_num):
    value, v_type = [_ for _ in input().split()]
    value = float(value)
    if str(v_type) == "JPY":
        ans = value
    elif str(v_type) == "BTC":
        ans = value * 380000.0
    
    otoshidama_box.append(float(ans))
otoshidama_box = np.array(otoshidama_box)
total = np.sum(otoshidama_box)
print(total)

Solution (Python):


BIT_RATE = 380000

N = int(input())
ans=0

for i in range(N):
    x, u = map(format, input().split())
    x=float(x)
    if u=="BTC":
        x*=BIT_RATE
    ans+=x
    
print(ans)

Solution (Python):
n = int(input())
s = []
for i in range(n):
    x,u = input().split()
    if u == "JPY":
        s.append(int(x))
    else:
        a = float(x)
        p = a * 380000
        s.append(p)
print(sum(s))

Solution (Python):
n = int(input())

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

Solution (Python):
n = int(input())
jpy = 0
btc = 0.0
for _ in range(n):
    money = list(input().split())
    if money[1] == 'JPY':
        jpy += int(money[0])
    else:
        btc += float(money[0])

print(jpy + (btc/1.0)*380000.0)

Solution (Python):

"""
Created on Sun Feb 24 21:16:26 2019

@author: Wataru
"""

N=int(input())

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

print(total)

Solution (Python):






def main():
    N = int(raw_input().strip())
    x = []
    for _ in range(N):
        instr = raw_input().strip().split(' ')
        if instr[1] == 'JPY':
            y=1
        else:
            y=0
        x.append((float(instr[0]), y))
    x.sort()
    

    sumy = 0.0
    for xx in x:
        if xx[1] == 1:
            sumy += xx[0]
        else:
            sumy += xx[0] * 380000.0
    print sumy


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    x = list(map(str,input().split()))
    a = x[0]
    b = x[1]
    if b == "JPY":
        ans += int(a)
    else:
        z = float(a)
        z *= 380000
        ans += z
print(ans)

Solution (Python):
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
print(ans)

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

Solution (Python):
N = int(input())
S = 0
for i in range(N):
  x, u = [i for i in input().split()]
  x = float(x)
  if u == "JPY":
    S += x
  elif u == "BTC":
    S += x*380000
print(S)

Solution (Python):
N = int(input())
x = [0.0] * N
u = [""] * N
currency = {"JPY": 1.0, "BTC": 380000.0}
for i in range(N):
    tmp = list(input().split())
    x[i] = float(tmp[0])
    u[i] = tmp[1]

print(sum([x[i] * currency[u[i]] for i in range(N)]))

Solution (Python):
N=int(input())
J='JPY'
B='BTC'
bit=380000.0
money=0
for i in range(N):
    a,b=input().split()
    a=float(a)
    if b==J:
        money+=a
    elif b==B:
        money+=bit*a
print(money)

Solution (Python):
n = int(input())
list_test = []
for i in range(n):
    x, y = input().split()
    a = [float(x), y]
    list_test.append(a)
    
ans = 0

for i in range(n):
    if list_test[i][1] == "JPY":
        ans += int(list_test[i][0])
    else:
        ans += list_test[i][0]*380000

print(ans)

Solution (Python):
N = int(input())
rtn = 0 

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

Solution (Python):
N = int(input())
XU = [input().split() for i in range(N)]

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

print(ans)

Solution (Python):
n=int(input())
r=0.0
for i in range(n):
  m,t=input().split()
  if t == 'JPY':
    r += float(m)
  else:
    r += float(m) * 380000.0
print(r)

Solution (Python):
n = int(input())
j_wallet = []
for i in range(n):
    inp = input().split()
    if inp[1] == "JPY":
        j_wallet.append(float(inp[0]))
    else:
        j_wallet.append(float(inp[0]) * 380000.0)
print(sum(j_wallet))

Solution (Python):
N=int(input())

goukei=float(0)
for i in range(N):
    x,y=input().split()
    if y=='BTC':
        goukei+=float(x)*380000
    else:
        goukei+=float(x)
print(goukei)

Solution (Python):
BTC_yen = 380000.0

n = int(input())
kazu = []
tani = []
kazu_tani = [[i for i in input().split()] for i in range(n)] 

goukei = 0.0
for kt in kazu_tani:
  if kt[1] == 'JPY':
    goukei += int(kt[0])
  elif kt[1] == 'BTC':
    goukei += float(kt[0]) * BTC_yen
  
print(goukei)

Solution (Python):
N = int(input())
SUM = 0
for i in range(N):
    ODM = input().split()
    if ODM[1] == "JPY":
        SUM = SUM + float(ODM[0])
    else:
        SUM = SUM + float(ODM[0])*380000
print(SUM)

Solution (Python):
N=int(input())

ans = 0
rate = 380000.0
b = 0

for i in [0]*N:
	x,u = input().split(' ')
	if u == 'JPY':
		x = int(x)
		ans += x
	else:
		x = float(x)
		b += x

ans = float(ans)
ans += b * rate
print(ans)

Solution (Python):
n = int(input())
s = []*100
for i in range(n):
  s.append(input().split())
ans = 0
for i in range(n):
  if s[i][1] == "JPY":
    ans += float(s[i][0])
  else:
    ans += float(s[i][0])*380000
print(ans)

Solution (Python):
n = int(input())
data  = [list(map(str, input().split())) for _ in range(n)]
sum = 0
for i in range(n):
  if data[i][1] == 'JPY':
    sum += int(data[i][0])
  else:
    sum += float(data[i][0])*380000
print(sum)

Solution (Python):
N = int(input())
total = 0
for _ in range(N):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        total += x
    elif u == "BTC":
        total = total + (x * 380000.0)
    
print(total)

Solution (Python):
sm=0.0
for i in xrange(int(raw_input())):
	n,s=raw_input().split()
	n=float(n)
	if s=="BTC":
		sm=sm+n*380000.0
	else:
		sm=sm+n
print "%.5f"%sm

Solution (Python):
n=int(input())

JPY=0
BTC=0

for i in range(n):
    s=input().split()
    x=float(s[0])
    u=s[1]
    if(u=="JPY"):
        JPY+=x
    else:
        BTC+=x

print(JPY+BTC*380000)

Solution (Python):
num = int(input())
total = 0
for i in range(num):
    gift = input().rstrip().split(" ")
    if gift[1] == "JPY":
        total += int(gift[0])
    elif gift[1] == "BTC":
        total += float(gift[0]) * 380000

print(total)

Solution (Python):
V_MAP = {'JPY':1.0,'BTC':380000.0}
N = int(input())
o = 0
for n in range(N):
    items = [s for s in input().split(" ")]
    x = float(items[0])
    u = items[1]
    o += x*V_MAP[u]
print(o)

Solution (Python):
n = int(input())
ans = 0.0
for i in range(n):
    a = input().split(" ")
    if a[1] == "JPY":
        ans += int(a[0])
    else:
        btc = round(380000.0*float(a[0]),8)
        ans += btc
print(ans)

Solution (Python):
n=int(input())
e=[[i for i in input().split()] for j in range(n)]


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

Solution (Python):
N=int(input())
A=[]
for i in range(0,N):
    a=list(input().split())
    a[0]=float(a[0])
    A.append(a)
sum1=0
for i in range(0,N):
    if A[i][1]=="JPY":
        sum1=sum1+A[i][0]
    else:
        sum1=sum1+A[i][0]*380000.0
print(sum1)

Solution (Python):
n = int(input())

list = [input().split() for i in range(n)]

sum = 0

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

print(sum)

Solution (Python):
N = int(input())

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

print(m)

Solution (Python):
input_n = input() 
cash_all = 0


list_cash = []
for i in range(int(input_n)):
  _ = input()
  list_cash.append(_)


list_tmp = []
for i in list_cash:
  list_tmp = i.split(' ')
  if list_tmp[1] == 'JPY':
    cash_all += int(list_tmp[0])
  else:
    cash_all += float(list_tmp[0]) * 380000.0
    
print(cash_all)

Solution (Python):
N = int(input())
a = []
for n in range(N):
    a.append(input().split())

sum_ = 0.0
for d in a:
    if d[1] == "JPY":
        sum_ += int(d[0])
    else:
        sum_ += float(d[0]) * 380000.0

print(sum_)

Solution (Python):


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

    
print(sum)

Solution (Python):
from sys import stdin


def btc_to_jpy(btc):
    return btc * 380000


def main():
    input_line_list = stdin.readlines()
    n = input_line_list[0]
    x_u_list = input_line_list[1:]
    otoshidama_sum = 0.0
    for x_u in x_u_list:
        x, u = x_u.split()
        x_float = float(x)
        
        if u == 'BTC':
            jpy = btc_to_jpy(x_float)
        else:
            jpy = x_float
        otoshidama_sum += jpy
    print(otoshidama_sum)


if __name__ == '__main__':
    main()

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

Solution (Python):
n = int(input())
lst = [input().split() for _ in range(n)]
ans = 0
for i in range(n):
    lst[i][0] = float(lst[i][0])
    if lst[i][1] == 'BTC':
        lst[i][0] *= 380000

    ans += lst[i][0]
print(ans)

Solution (Python):
n = int(input())
x = [[a for a in input().split()] for i in range(n)]

y = []
for i in x:
    if i[1] == 'JPY':
        y.append(int(i[0]))
    else:
        y.append(float(i[0]) * 380000)

print(sum(y))

Solution (Python):
n=int(input())
lst=[list(input().split()) for i in range(n)]
y=0
b=0
for i in lst:
  if(i[1]=="JPY"):
    y+=int(i[0])
  else:
    b+=float(i[0])
print(y+b*380000)

Solution (Python):
N = int(input())
money = 0
for i in range(N):
    amount, kind = input().split(' ')
    amount = float(amount)
    if(kind == 'JPY'):
        money += amount
    else:
        money += amount * 380000
print(money)

Solution (Python):
N=int(input())
Y=[]
for i in range(N):
  list=input().split()
  money=float(list[0])
  if list[1]=="JPY":
    Y.append(money)
  else:
    Y.append(380000.0*money)
all=0
for j in Y:
  all+=j
print(all)

Solution (Python):
n = int(input())
num = [input().split() for i in range(n)]
mon = 0
for i in range(n):
    if num[i][1] == "JPY":
        mon += int(num[i][0])
    else:
        mon += float(num[i][0])*380000.0
print(mon)

Solution (Python):
x=[]
u=[]
N = int(input())
for i in range(N):
  X, U = input().strip().split(' ')
  x.append(X)
  u.append(U)
sum = 0
  
for i in range(N):
  if u[i] == "JPY":
    sum = sum + int(x[i])
  else:
    sum = sum + float(x[i]) * 380000

print(sum)

Solution (Python):
N = int(input())
O = [input().split() for i in range(N)]
sum = 0
for o in O:
  x, u = o
  if u == "JPY":
    sum += int(x)
  else:
    sum += 380000*float(x)
print(sum)

Solution (Python):

n = int(input())
data = []
for i in range(n):
    a, b = map(str, input().split())
    data.append([float(a), b])

jpy_sum = 0
btc_sum = 0
for j in range(n):
    if data[j][1] == 'JPY':
        jpy_sum += data[j][0]
    else:
        btc_sum += data[j][0]

print(jpy_sum + 380000.0 * btc_sum)

Solution (Python):
n = int(input())

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

Solution (Python):
n = int(input())
y = 0.0
for i in range(n):
  x,u = input().split()
  x = float(x)
  if u == "BTC":
    x *= 380000
  y += x
print(y)

Solution (Python):
N = int(input())
s = 0

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

  if u == "BTC":
      x *= 380000.0

  s += x
 
    
print(s)

Solution (Python):
N=int(input())
l=[]
L=[]
for i in range(N):
  a,b=(input().split())
  l.append((a,b))
for i in range(N):
    c,d=l[i]
    if d=="JPY":
        L.append(float(c))
    else:
        L.append(float(c)*380000.0)
print(sum(L))

Solution (Python):
N = int(input().strip())
XU = []
for i in range(N):
	XU.append(list(map(str, input().strip().split(' '))))	

kane = 0

for i in range(N):
    if(XU[i][1] == "BTC"):
        kane = kane + float(XU[i][0])*380000
    else:
        kane = kane + float(XU[i][0])

print(kane)

Solution (Python):
N = int(input())
Money = []
Tot   = 0


for n in range(N):
	 Money.append(input().split())

for n in range(N):
	if Money[n][1] == "JPY":
		Tot += float(Money[n][0])
	else:
		Tot += float(Money[n][0])*380000

print(Tot)

Solution (Python):
N = int(input())
x = [''] * N
u = [''] * N
for i in range(N):
	x[i], u[i] = [i for i in input().split()]

ans = sum([int(x[i]) for i in range(N) if u[i] == 'JPY'])
ans += sum([float(x[i])*380000.0 for i in range(N) if u[i] == 'BTC'])
print(ans)

Solution (Python):
import numpy as np

N = int(input())
X = np.array([0. for i in range(N)])
U = np.array([0. for i in range(N)])

for i in range(N):
	x, u = input().split()
	x = float(x)
	X[i] = x
	if u == 'JPY':
		U[i] = 1.0
	elif u == 'BTC':
		U[i] = 380000.0

A = np.dot(X,U)

print(A)

Solution (Python):
n = int(input())
sum = 0.0
for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        sum += float(x)
    elif u == 'BTC':
        sum += float(x) * 380000.0
print(sum)

Solution (Python):
N = int(input())

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

Solution (Python):
n = int(input())
money = [input().split() for i in range(n)]
total = 0

for m in money:
    if m[1] == "BTC":
        total += float(m[0])*380000
    else:
        total += int(m[0])

print(total)

Solution (Python):
N = int(input())
sum_ = 0
for i in range(N):
  tmp = input()
  tmp = tmp.split(" ")
  x = float(tmp[0])
  u = tmp[1]
  
  if(u=="JPY"):
    sum_ += x
  else:
    sum_ += x*380000
  
print(sum_)

Solution (Python):
N = int(input())

ans = 0.0
BTC = 380000.0

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

print(ans)

Solution (Python):
n = int(input())
otosidamas = [[]*2]*n
BTCtoJPY = 380000.0
sum = 0

for i in range(len(otosidamas)):
    otosidamas[i] = input().split()
    otosidamas[i][0] = float(otosidamas[i][0])
    if otosidamas[i][1] == "BTC":
        sum += BTCtoJPY * otosidamas[i][0]
    else:
        sum += otosidamas[i][0]


print(sum)

Solution (Python):
n = int(input())
otoshi = [input().split() for i in range(n)]

sumyen = 0
for i in range(n):
    if otoshi[i][1] == 'JPY':
        sumyen += float(otoshi[i][0])
    else:
        sumyen += float(otoshi[i][0])*380000

print(sumyen)

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

Solution (Python):

N = int(input())
sum = 0
e = [[i for i in input().split()] for i in range(N)] 

for i in e:
    if i[1] == "JPY":
        sum += int(i[0])
    else:
        sum += float(i[0])*380000
print(sum)

Solution (Python):
total = 0
times = int(input())
for i in range(times):
    value = input().rstrip().split(" ")
    if(value[1]=="JPY"):
        total += int(value[0])
    else:
        total += (float(value[0])*380000)
print(total)

Solution (Python):
N = int(input())

bit1 = 380000.0

ans = 0

for i in range(N):
    S = input().split()
    if S[1] == 'JPY':
        ans += float(S[0])
    elif S[1] == 'BTC':
        ans += (float(S[0]) * bit1)

print(ans)

Solution (Python):
n = int(input())
x = [list(input().split()) for i in range(n)]
j = [float(v[0]) for v in x if v[1] == 'JPY']
b = [float(v[0]) * 380000 for v in x if v[1] == 'BTC']
print(sum(j)+sum(b))

Solution (Python):
N = int(input())
l = [input().split() for i in range(N)]

total = 0
for x in l:
    if x[1] == "JPY":
        total += float(x[0])
    if x[1] == "BTC":
        total += float(x[0]) * 380000.0
print(total)

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

Solution (Python):
n = int(input())

sum = 0.00000

for i in range(n):
	V, T= input().split()
	V = float(V)
	if T == "JPY":
		sum = sum + V
	else:
		sum = sum + V*380000.0

print(sum)

Solution (Python):
N=int(input())
bit=380000.0
sum=0.0
for a in range(N):
    x,u=input().split(" ")
    x=float(x)
    if(u=="BTC"):
        sum+=bit*x
    else:
        sum+=x
print(sum)

Solution (Python):
import numpy as np
from collections import defaultdict






N = int(input())  
x_list = list()
u_list = list()
for i in range(N):
    x, u = input().split(' ')  
    x = float(x)
    
    
    x_list.append(x)
    u_list.append(u)

suma = 0
for x, u in zip(x_list, u_list):
    if u == "JPY":
        suma += x
        pass
    elif u == "BTC":
        suma += x*380000
print(suma)

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

Solution (Python):
hoge = []
N = int(input())
for i in range(N):
    hoge.append(input().split())

btc = 380000
a = 0
for e in hoge:
    if e[1] == 'JPY':
        a += float(e[0])
    else:
        a += float(e[0]) * btc
print(a)

Solution (Python):
N = int(input())
x_list = [0] * N
u_list = [0] * N
rate = 380000.0

total = 0.0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
        total += rate * x
    else:
        total += x

print(total)\

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

Solution (Python):
n = int(input())

s = 0
for i in range(n):
    v,k = input().split()
    if(k == 'BTC'):
        s = s + float(v)*380000.0
    elif(k == 'JPY'):
        s = s + int(v)
        
print(s)

Solution (Python):
n = int(input())
arr = [list(input().split()) for i in range(n)]

ans = 0

for j in range(n):
    if arr[j][1] == 'JPY':
        ans += int(arr[j][0])
    else:
        ans += float(arr[j][0]) * 380000.0
        
print(ans)

Solution (Python):
n = int(input())
otl = [input().split() for i in range(n)]

sum = 0
for m in range(len(otl)):
  if otl[m][1] == 'JPY':
    sum += float(otl[m][0])
  elif otl[m][1] == 'BTC':
    sum += float(otl[m][0])*380000.0
print(sum)

Solution (Python):
n = int(input())
money = []
sum = 0

for i in range(n):
    x, u = list(map(str, input().split()))
    x = float(x)
    money.append([x,u])

for i in range(n):
    if money[i][1] == 'JPY':
        sum += money[i][0]
    else:
        sum += money[i][0] * 380000

print(sum)

Solution (Python):
num = int(input())

inputs = []
total = 0.0

for i in range(num):
  line = input().split(' ')
  
  if line[1] == 'JPY':
    total += int(line[0])
  elif line[1] == 'BTC':
    total += float(line[0]) * 380000.0

print(total)

Solution (Python):
rate = 380000.0 
sum = 0

N = int(input())

for n in range(N):
    x, u = input().split()
    if u == 'JPY':
        sum += float(x)
    else:
        sum += float(x) * rate

print(sum)

Solution (Python):

sum_ = 0
N = int(input())
for i in range(N):
    num, type_ = input().split()
    if type_ == "JPY":
        sum_ += float(num)
    else:
        sum_ += float(num) * 380000
print(sum_)

Solution (Python):
N = int(input())

ans = 0
for _ in range(N):
    value, kahei = input().split()
    value = float(value)
    if kahei == 'JPY':
        ans += value
    else:
        ans += 380000 * value

print(ans)

Solution (Python):
Ot = 0
N = int(input())
for i in range (N):
    X = input().split()
    x = float(X[0])
    if X[1] == "BTC":
        Ot += x * 380000
    else:
        Ot += x
print(Ot)

Solution (Python):
N = int(input())
od = []

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

print(sum)

Solution (Python):
N = int(input())

money = 0.0
def calc(list1, money):
    if list1[1] == 'JPY':
        return money + float(list1[0])
    else:
        return money + float(list1[0]) * 380000.0

for i in range(N):
    money = calc(input().split(), money)

print(money)

Solution (Python):
n = int(input())
S = 0
for i in range(n):
    a = input().split()
    if a[1] == "BTC":
        S += float(a[0]) * 380000.0
    else :
        S+= float(a[0])
print(S)

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

Solution (Python):
n=int(input())
ans=0.0
for i in range(n):
    li = input().split()
    if li[1]=="BTC":
        ans+=380000.0*float(li[0])
    else:
        ans+=float(li[0])
print(ans)

Solution (Python):
N = int(input())
total = 0
BTC = 380000
for i in range(N):
  x,u = input().split()
  if u == "JPY":
    total += int(x)
  else:
    total += float(x) * BTC
    
print(total)

Solution (Python):
n = int(input())
listA = []
ans = 0
for i in range(n):
    listA.append(list(input().split()))

for i in range(n):
    if listA[i][1] == "JPY":
        ans += float(listA[i][0])
    elif listA[i][1] == "BTC":
        ans += float(listA[i][0]) * 380000.0

print(ans)

Solution (Python):
n = int(input())
data = [input().split() for _ in range(n)]

s = 0

for d in data:
  s1 = float(d[0])
  if d[1] == "BTC":
    s += s1 * 380000.0
  else:
    s += s1
print(s)

Solution (Python):
N = int(input())
xv = []
for i in range(N):
  x,v = input().split()
  if v == "BTC":
    x=float(x)
  else:
    x=int(x)
  xv.append([x,v])
dama=0
for i in range(N):
    if xv[i][1] == "JPY":
        dama+=xv[i][0]
    else:
        dama+=xv[i][0]*380000.0
print(dama)

Solution (Python):
N = int(input())
JPY_BTC = 380000.0
total = 0
for _ in range(N):
    tmp = input().split()
    yen = float(tmp[0])
    if tmp[1] == 'BTC':
        yen = yen * JPY_BTC
    total += yen
print(total)

Solution (Python):
n = input()

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

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

print(ans)

Solution (Python):


"""
Created on 2019/2/24
Solved on 2019/2/24
@author: shinjisu
"""



def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


ALPHABET = [chr(i+ord('a')) for i in range(26)]
DIGIT = [chr(i+ord('0')) for i in range(10)]
N1097 = 10**9 + 7


def dmp(x, cmt=''):
    global debug
    if debug:
        if cmt != '':
            print(cmt, ':  ', end='')
        print(x)
    return x


def probB():
    N = getInt()
    dmp(N)
    sm = 0.0
    for i in range(N):
        x, u = [a for a in input().split()]
        dmp((x,u))
        if u == 'JPY':
            x = int(x)
        else:
            x = float(x) * 380000.0
        sm += x
    return sm


debug = False  
print(probB())


def gcd(x, y):  
    m = max(x, y)
    n = min(x, y)
    while m % n != 0:
        w = m % n
        m = n
        n = w
    return n


def probC():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    hp = A[N-1]
    for i in range(N-1):
        hp = gcd(hp, A[i])
        dmp(hp)
    return hp


def probD():
    N, M = getIntList()
    A = getIntList()
    dmp((N, M))
    dmp(A)
    return num


def probA():
    S = input()
    dmp(S)
    y = int(S[0:4])
    m = int(S[5:7])
    d = int(S[8:10])
    dmp((y,m,d))
    HEI = 'Heisei'
    if y <= 2018:
        return HEI
    if m <= 4:
        return HEI
    else:
        return 'TBD'

Solution (Python):
n = int(input())

sum = 0.0
for i in range(n):
    s = input().split(" ")
    x = float(s[0])
    u = s[1]
    if u == "JPY":
        sum += x
    else:
        sum += 380000 * x

print(sum)

Solution (Python):
n = int(input())

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

print(ans)

Solution (Python):
N = int(input())

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

print(yen)

Solution (Python):

N = int(input())
r = 0
m = {"JPY":1,"BTC":380000}
for _ in range(N):
    i,j = input().split()
    i = float(i)
    r += i*m[j]
print(r)

Solution (Python):
N = int(input())

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

print(otoshidama)

Solution (Python):
N = int(input())
list_=[input().split() for i in range(N)]
sum_= 0
for i in list_:
	if i[1]=="JPY":
		sum_ += int(i[0])
	else:
		sum_ += float(i[0])*380000
print(sum_)

Solution (Python):
N=int(input())  
X = [0] * N
U = [0] * N

for i in range(N):
    X[i], U[i] = input().split()
    X[i] = float(X[i])

ans=0
for i in range(N):
    if U[i] =="JPY":
        ans += X[i]
    else:
        ans += X[i] * 380000

print(ans)

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

Solution (Python):
n = int(input())
a = []
sum = 0
for _ in range(n):
    a.append(list(input().split()))
for x in a:
    if x[1] == 'JPY':
        sum += int(x[0])
    else:
        sum += float(x[0])*380000
print(sum)

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

Solution (Python):
def main():
    N = int(input())
    money = 0
    for i in range(N):
        x, u = map(str, input().split())
        x = float(x)
        if u == 'JPY':
            money += x
        elif u == 'BTC':
            money += x * 380000

    print(money)


if __name__ == '__main__':
    main()

Solution (Python):
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)

Solution (Python):
N = int(input())
total = 0.0
for _ in range(N):
  x, u = input().split()
  x = float(x)
  if u == 'JPY':
    total += x
  else:
    total += 380000.0 * x

print(total)

Solution (Python):
N=int(input())
ans=0
for i in range(N):
  m,t=input().split()
  if t=='JPY':
    ans+=int(m)
  else:
    indi,low=m.split('.')
    ans+=int(indi)*380000.0+int(low)*(10**(-8))*380000.0
    
print(ans)

Solution (Python):
num = int(input())
sum = 0
for _ in range(num):
  data = input()
  data_lst = data.split()
  if data_lst[1]=="JPY":
    sum+=int(data_lst[0])
  else:
    sum+=float(data_lst[0])*380000.0

print(sum)

Solution (Python):
n = int(input())
jp_list = []
btc_list = []
for i in range(n):
    s = list(input().split())
    if s[1] == 'JPY':
        jp_list.append(float(s[0]))
    else:
        btc_list.append(float(s[0]))
print(sum(jp_list)+sum(btc_list)*380000)

Solution (Python):


import sys

def _main():
    N = int(input())

    total = 0

    for n in range(N):
        text = input()
        data = text.split(' ')
        
        if data[1] == 'JPY':
            total += int(data[0])
        elif data[1] == 'BTC':
            total += float(data[0]) * 380000

    print(total)

if __name__ == '__main__':
    _main()

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

Solution (Python):
n = int(input())

x =[]
y =[]
for i in range(n):
    x1, y1 = [i for i in input().split()]
    x.append(x1)
    y.append(y1)


ans = 0
for i in range(n):
    if y[i] == "JPY":
        ans += int(x[i])
    else:
        ans+= float(x[i])*380000

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
iTotal  = 0.0
for _ in range(N):
    x,u=input().split()
    x = float(x)
    if u == "BTC":
        x = x * 380000.0
    iTotal += x
print(iTotal)

Solution (Python):
y = 0
n = int(input())

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

	if x[1] == 'JPY':
		y += float(x[0])
	else:
		y += float(x[0])*380000.0

print(y)

Solution (Python):
N = int(input())

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

print(total)

Solution (Python):


import sys

def main():
    n = int(sys.stdin.readline())

    total = 0
    for _ in range(n):
        l = sys.stdin.readline().split(" ")
        x, u = float(l[0]), l[1].strip()
        if u == "JPY":
            total += x
        else:
            total += x * 380000.0

    print(total)

main()

Solution (Python):
N = int(input())
xu = [input().split(" ") for _ in range(N)]

def f(x, u):
    if u == "JPY":
        return int(x)
    else:
        return float(x) * 380000.0

print(sum(f(x, u) for x, u in xu))

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

Solution (Python):
n = int(input())
xu = []
for i in range(n):
    x, u = input().split()
    xu.append((float(x), u))

yen = []
for x, u in xu:
    if u == "JPY":
        yen.append(x)
    else:
        yen.append(x*380000.0)

print(sum(yen))

Solution (Python):
N = int(input())
Y = 0
rate =  380000.0
for _ in range(N):
    x = input().split()
    if x[1] == "JPY":
        Y += float(x[0])
        continue
    else:
        Y += float(x[0]) * rate
    
print(Y)