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):
n = int(input())
total = 0

for i in range(n):
    tmp = list(map(str, input().split()))
    if tmp[1] == 'JPY':
        total+=float(tmp[0])
    else:
        total+=float(tmp[0])*380000
        
print(total)

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

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

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

Solution (Python):
N = int(input())
lst = [list(input().split()) for row in range(N)]

btc_to_jpy = 380000.0
total_value = 0
i = 0
while i < N:
	value = float(lst[i][0])
	if lst[i][1] == 'JPY':
		total_value += value
	else:
		total_value += value * btc_to_jpy
	i = i + 1
print(total_value)

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


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):

import sys










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

    otoshidamas = []
    for _ in range(n):
        x, u = sys.stdin.readline().split()
        x = float(x)
        otoshidamas.append([x, u])
    
    total = 0
    for i in range(n):
        if otoshidamas[i][1] == 'JPY':
            total += otoshidamas[i][0]
        else:
            total += otoshidamas[i][0] * 38e4
    
    print(total)


if __name__ == "__main__":
    main()

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

Solution (Python):
def func1(lst, value): return [i for i, x in enumerate(lst) if x == value]
def func2(coping, lst, coefficient=1):return sum(lst[i] * coefficient for i in coping)
lst = [input().split(' ') for i in range(int(input()))]
X = [float(i[0]) for i in lst]
Y = [i[1] for i in lst]
print(func2(func1(Y,"BTC"),X,380000.0) + func2(func1(Y,"JPY"),X))

Solution (Python):
def func1(lst, value): return [i for i, x in enumerate(lst) if x == value]
def func2(coping, lst, coefficient=1):return sum(lst[i] * coefficient for i in coping)

lst = [input().split(' ') for i in range(int(input()))]
X = [float(i[0]) for i in lst]
Y = [i[1] for i in lst]

print(func2(func1(Y,"BTC"),X,380000.0) + func2(func1(Y,"JPY"),X))

Solution (Python):
def func1(lst, value):
    return [i for i, x in enumerate(lst) if x == value]

X,Y = [],[]
ans = 0

N = int(input())
for i in range(N):
    x,y = input().split(' ')
    X.append(float(x))
    Y.append(y)

btc = func1(Y,"BTC")
jpy = func1(Y,"JPY")

for i in btc:

    ans = ans + (X[i] * 380000.0)

for i in jpy:
    ans = ans + X[i]

print(ans)

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

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

list = []
for _ in range(n):
    a,b = input().split()
    if b == "JPY":
        list.append(int(a))
    else:
        a = 380000.0 * float(a)
        list.append(a)
print(sum(list))

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

ans = 0

for i in range(n) :
    digit, unit = map(str, input().split())
    if unit == 'JPY' :
        ans += float(digit)
    else :
        ans += float(digit) * 380000

print(ans)

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

Solution (Python):
N=int(input())
A=[0]*N
B=['0']*N
count=0
for i in range(N):
  A[i],B[i]=input().split()
for i in range(N):
  if B[i]=='BTC':
    count+=float(A[i])*380000.0
  else:
    count+=float(A[i])
print(count)

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

Solution (Python):
N = int(input())
l = []
ans = 0
for i in range(N):
  l.append(list(map(str, input().split())))
  l[-1][0] = float(l[-1][0])

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

Solution (Python):
n = int(input())
print(sum(float(x) * 38e4 ** (int(u == "BTC")) for x, u in [input().split() for _ in range(n)]))

Solution (Python):
n = int(input())
print(sum(float(x) * (int(u == "BTC") * 379999 + 1) for x, u in [input().split() for _ in range(n)]))

Solution (Python):

import numpy as np
N = int(input())
x = np.zeros(N)
u = []
for i in range(N):
  xx, uu = input().split()
  x[i] = float(xx)
  u.append(uu)

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

print(sum)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

main()

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

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

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

money = 0
for x, u in drop_ball:
  if u == "JPY":
    money += float(x)
  else:
    money += float(x) * 380000

print(money)

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

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

print(cnt)

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

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

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

Solution (Python):
N = int(input())
group = [input().split() for _ in range(N)]
count = 0

for i in range(N):
  if group[i][1]=="JPY":
    count += int(group[i][0])
  else:
    count += float(group[i][0])*380000.0
print(count)

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
li = [list(stdin.readline().rstrip().split()) for _ in range(n)]

total = 0.0

for i in range(n):
    if li[i][1] == "BTC":
        total += float(li[i][0])*380000
    else:
        total += float(li[i][0])

print(total)

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

Solution (Python):
n=int(input())
v=[]
name=[]
ans=0
for i in range(n):
    x,y=input().split()
    v.append(float(x))
    name.append(y)
for j in range(n):
    if name[j]=='JPY':
        ans+=v[j]
    else:
        ans+=380000.0*v[j]
print(ans)

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

ans = 0
for val in range(n):
    x,u = map(str,input().split())
    if u == "JPY":
        tanni = 1.0
    else:
        tanni = 380000.0
    ans = ans + tanni * float(x)

print(ans)

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

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

Solution (Python):
N=int(input())  
x = []
u = []
price=[]
for i in range(N):
    x1,y1=[i for i in input().split()]
    x.append(float(x1))
    u.append(y1)

for j in range(N):
    if u[j]=='BTC':
        price.append(x[j]*380000.0)
    else:
        price.append(x[j])

print(sum(price))

Solution (Python):

n = int(input())



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

print(to)

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

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

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

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

for _ in range(N):
    x, u = map(str, input().split())
    X.append(float(x))
    if u == 'JPY':
        U.append(1)
    else:
        U.append(380000)

for n in range(N):
    count += X[n] * U[n]

print(count)

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

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

    if u == 'JPY' :
        ret += x
    else :
        ret += x * 380000
print(ret)

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

Solution (Python):
N = int(input())
xu_list = [[x for x in input().split()] for _ in range(N)]
BTC = 380000
ans = 0
for x, u in xu_list:
    ratio = 1 if (u == 'JPY') else BTC
    ans += float(x) * ratio
print(ans)

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

Solution (Python):

N, *x = [list(s.split()) for s in open(0)]

sum = 0
for i, j in x:
    if (j == 'JPY'):
        sum += float(i)
    else:
        sum += float(i)*380000
print(sum)

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

total = 0

for i in range(N):
	X = list(input().split())
	X[0] = float((X[0]))
	if X[1] == "BTC":
		X[0] = X[0] * 380000

	total += X[0]
	
print(total)

Solution (Python):
n = int(input())
ans = []
for _ in range(n):
    price, currency = input().split(' ')
    price = float(price)
    if currency == 'BTC':
        price = price*380000
    ans.append(price)
print(sum(ans))

Solution (Python):
n = int(input())
x = [0] * n

for i in range(n):
    amount, unit = map(str, input().split())
    x[i] = float(amount)
    if unit == "BTC":
        x[i] *= 380000.0

ans = sum(x)
print(ans)

Solution (Python):

def main():
    _, *XU = open(0).read().split()
    ans, RATE = 0, 380000
    for x, u in zip(*[iter(XU)] * 2):
        x = float(x)
        ans += x if u == "JPY" else x * RATE
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    N = int(input())
    otoshidama_list =  [input() for i in range(N)]

    total_price = 0
    for otoshidama in otoshidama_list:
        amount,currency =  map(str, otoshidama.split())
        amount = float(amount)
        if currency == 'BTC':
            amount = amount * 380000
        total_price += amount
    
    print(total_price)

if __name__ == "__main__":
    main()

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

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

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

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

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

Solution (Python):
from sys import stdin

N = int(stdin.readline())

ans = 0.0
for i in range(N):
    x,u = stdin.readline().rstrip().split(' ')
    if u=='JPY':
        ans += float(x)
    else:
        ans += float(x) * 380000.0

print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    ans += eval(input().replace(" ","*").replace("JPY","1").replace("BTC","380000"))
print(ans)

Solution (Python):
n = int(input())
ans = 0
for _ in range(n):
    x, u = map(str, input().split())
    x = float(x)
    if u == "JPY":
        ans += x
    elif u == "BTC":
        ans += x*380000.0

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

    elif u == "BTC":
        ans += 380000.0 * x

print(ans)

Solution (Python):
N = int(input())
ans = 0
money = []
for _ in range(N):
    x , u = input().split()
    money.append([float(x) , u])

for i in range(N):
    if money[i][1] == "JPY":
        ans += money[i][0]
    else:
        ans += money[i][0] * 380000.0
print(ans)

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

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

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

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

Solution (Python):
N=int(input())
x = []
u = []
for _ in range(N):
    xt,ut = input().split()
    xt = float(xt)
    x.append(xt)
    u.append(ut)
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())
total = 0

for i in range(n):
  x_temp, u_temp = input().split()
  x_temp = float(x_temp)
  if u_temp == 'BTC':
    x_temp *= 380000.0
  total += x_temp
  
print(total)

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

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

Solution (Python):
N = int(input())
A = [list(map(str,input().split())) for _ in range(N)]

ans = 0
for a in A:
    if a[1] == 'JPY':
        ans += int(a[0])
    else:
        ans += float(a[0]) * 380000
print(ans)

Solution (Python):
N=int(input())
RATE=380000
ans=0

for _ in range(N):
    x,u = [i for i in input().split()]
    x=float(x)
    if u=="JPY":
        ans+=x
        continue
    else:
        ans+=x*RATE
print(ans)

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

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

Solution (Python):
N = int(input())
dic = {}
for _ in range(N):
    vals = input().split()
    if vals[1] not in dic:
        dic[vals[1]] = float(vals[0])
    else:
        dic[vals[1]] += float(vals[0])
tot = 0  
for k in dic:
    if k == "JPY":
        tot += dic[k]
    else:
        tot += dic[k] * 380000.0
print(tot)

Solution (Python):


N = int(input().split()[0])
xu_list = []

for _ in range(N):
    x, u = list(input().split())
    xu_list.append((float(x), u))

total = 0

for xu in xu_list:
    x, u = xu
    total += x * 38 * 10 ** 4 if u == "BTC" else x

ans = total
print(ans)

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

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

Solution (Python):
n = int(input())
sum = 0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    sum += int(a)
  else:
    sum += float(a)*380000
print(sum)

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

s=0

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

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

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

Solution (Python):
N=int(input())
MONEY=0
for i in range(N):
    a,b=input().split()

    if b=='BTC':
        MONEY+= float(a)*380000

    elif b=='JPY':
        MONEY+= int(a)

print(MONEY)

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

Solution (Python):
N=int(input())
l1=[]
l2=[]
for _ in range(N):
  x,u=input().split()
  if u=='JPY':
    l1.append(int(x))
  elif u=='BTC':
    l2.append(float(x))
print(sum(l1)+sum(l2)*380000)

Solution (Python):
n = int(input())
x = [0.]*n
u = ['']*n
for i in range(n):
    xu = input().split()
    x[i], u[i] = float(xu[0]), str(xu[1])

sum = 0
for i in range(n):
    if u[i] == 'BTC':
        sum += x[i] * 380000.0
    else:
        sum += x[i]

print(sum)

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

Solution (Python):
ans = 0
for _ in range(int(input())):
  X,U = input().split()
  ans += float(X) if U == 'JPY' else float(X)*380000
print(ans)

Solution (Python):
N=int(input())
c=0
for i in range(N):
    x,u=map(str,input().split())
    c+=float(x)*((u[0]=='B')*379999+1)
print(c)

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

Solution (Python):
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *

from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    N = int(input())
    ans = 0
    for i in range(N):
        num,st = input().rstrip().split(' ')
        num = float(num)
        if st == 'JPY':
            ans += num
        else:
            ans += num*380000
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
d = {"JPY" : 1.0, "BTC" : 380000.0}
ans = 0
for _ in range(n):
    x, u = input().split()
    ans += float(x) * d[u]
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    btc = 380000
    t = 0
    for _ in range(n):
        v, k = input().split()
        v = float(v)
        t += v if k == "JPY" else v * btc
    print(t)


if __name__ == "__main__":
    main()

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    t = 0
    for i in range(n):
        a, b = list(map(str, str(input().rstrip('\n')).split()))
        if b == "JPY":
            t += int(a)
        else:
            t += (float(a) * 380000)
    print(t)


if __name__ == '__main__':
    slove()

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

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

print(total_amount)

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

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

Solution (Python):
import sys
input = sys.stdin.readline


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

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



if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
x = []
u = []
ans = 0
for i in range(n):
    x1,u1 = [str(i) for i in input().split()]
    x.append(x1)
    u.append(u1)
for i in range(n):
    if u[i] == 'BTC':
        ans += float(x[i]) * 380000.0
    else:
        ans += int(x[i])
print(ans)

Solution (Python):
N = int(input())
ans = 0
btc = 0
for i in range(N):
    x, u = input().split()
    if u == 'JPY':
        ans += int(x)
    elif u == 'BTC':
        btc += float(x)
ans += btc * 380000.0
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:
        ans+= x*380000
print(ans)

Solution (Python):


n = input()
RATE = 380000.0
ans = 0.0
for i in range(n):
    inpt = map(str, raw_input().split())
    if inpt[1] == "JPY":
        ans += float(inpt[0])
    else:
        ans += float(inpt[0]) * RATE

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:
            ans += x*380000
print(ans)

Solution (Python):
n=int(input())
XU=[tuple(map(str,input().split())) for i in range(n)]

jpy=0
btc=0

for xu in XU:
    x=xu[0]
    u=xu[1]
    if u=="JPY":
        jpy+=int(x)
    else:
        btc+=float(x)
        
print(jpy+380000*btc)

Solution (Python):
n = int(input())
dic = {"JPY": 1, "BTC": 380000}
ans = 0
for i in range(n):
  x,u = input().split()
  ans += float(x) * dic[u]
print(ans)

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

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

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

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

x = []
u = []

for i in range(n):
  money,label = input().split()
  x.append(float(money))
  u.append(label)

sum = 0

for i in range(n):
  if u[i] == "BTC":
    sum += (x[i]) * 380000
  else:
    sum += (x[i])
    
print(sum)

Solution (Python):
s=int(input())
jpy=0
btc=0
for i in range(s): 
  t,u=input().split()
  if u=='JPY':
    jpy+=int(t)
  else:
    btc+=float(t)
print(jpy+380000*btc)

Solution (Python):
import sys
sys.setrecursionlimit(5 * 10**5)
input = sys.stdin.readline

N = int(input())

jpy = 0
btc = 0

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

    if u == "JPY":
        jpy += int(x)
    else:
        btc += float(x)

print(jpy + btc * 380000)

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 += x * 380000
print(ans)

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

Solution (Python):
N= int(input())
total_otoshidama = float(0)
otoshidama_list = []
for i in range(N):
    xi, ui = input().split()
    if ui == 'BTC':
        xi = float(xi)
        xi = xi*380000
    else:
        xi = int(xi)
    total_otoshidama += xi
print(total_otoshidama)

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

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

total = 0
for gift in gifts:
    if gift[1] == "JPY":
        total += float(gift[0])
    else:
        total += float(gift[0]) * 380000

print(total)

Solution (Python):
n = int(input())
x = [list(map(str, input().split())) for _ in range(n)]

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

print(ans)

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

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

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

Solution (Python):
n = int(input())
XU = [input().split() for _ in range(n)]
print(sum(float(x)*{'JPY': 1, 'BTC': 380000}[u] for x, u in XU))

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

Solution (Python):
n = int(input())
def calc(p):
  if p[1]=='JPY':
    return int(p[0])
  else:
    return float(p[0])*380000.0
ans = 0
for _ in range(n):
  a = input().split()
  ans += calc(a)
print(ans)

Solution (Python):
n=int(input())
ans=0
for _ in range(n):
    x,u=input().split()
    if u=='JPY': ans+=int(x)
    else: ans+=float(x)*38e4
print(ans)

Solution (Python):
N = int(input())
otoshidama = []
for n in range(N):
    val, cur = map(str, input().split())
    val = float(val)
    if cur == "BTC":
        val *= 380000
    otoshidama.append(val)
print(sum(otoshidama))

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

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

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

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

sum=0
for i in range(N):
    a,b =input().split()
    c=float(a)
    if b == 'BTC':
        c=c*380000
    sum +=c
    
print(sum)

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

ans = 0

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

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

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

n=int(input())

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

cnt=0

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

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

jpy = btc = 0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if 'JPY' == u:
        jpy += x
    else:
        btc += x

btc = 380000.0 * btc
print(jpy + btc)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    inp = input().split()
    x = float(inp[0])
    u = inp[1]
    if u == 'JPY':
        ans += x
    if u == 'BTC':
        ans += x*380000

print(ans)

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

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

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

res = 0

for xu in XU:
    if xu[1] == 'BTC':
        res += float(xu[0])* 380000
    else:
        res += int(xu[0])

print(res)

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

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

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

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

print(result)