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())
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):
print(sum(float(s[:-4])*[380000,1][s[-4]>'C']for s in open(0).readlines()[1:]))

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

ret = 0

for n in range(N):
	price, moneyType = input().split()
	price = float(price)

	if moneyType == "JPY":
		ret += price
	elif moneyType == "BTC":
		ret += price * 380000


print(ret)

Solution (Python):
N = int(input())
z = [0, 0]
for i in range(N):
  u = input().split()
  z[u[1] == 'BTC'] += float(u[0])

print(z[0] + z[1] * 380000)

Solution (Python):
N = int(input())
x = []
sigma_yen = 0
sigma_btc = 0.0

for i in range(N):
    x.append(input().split())



for i in range(N):
    if x[i][1] == 'JPY':
        sigma_yen += int(x[i][0])
    else:
        sigma_btc += float(x[i][0])


sigma = float(sigma_yen) + (sigma_btc * 380000.0)

print(sigma)

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

Solution (Python):
print(sum(float(s[:-4])*((s[-4:]>'C')or 380000)for s in open(0).readlines()[1:]))

Solution (Python):

import sys



def solve(lines):
    N = int(lines.pop(0))
    res = 0
    for i in range(N):
        x,u = lines.pop(0).split(' ')
        if u == 'BTC':
            res += 380000.0 * float(x)
        else:
            res += int(x)
    print(res)

lines = [x.strip() for x in sys.stdin.readlines()]




solve(lines)

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    print(sum(float(x) * (1 if u == 'JPY' else 380000) for x, u in (input().split() for _ in range(n))))

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

otoshidama = 0

for i in range(n):
    if data[i][1] == "JPY":
        nedan = float(data[i][0])
    if data[i][1] == "BTC":
        nedan = float(data[i][0]) * 380000
    otoshidama = otoshidama + nedan

print(otoshidama)

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

result = 0
for i in range(n):
    inp = input().split()
    x, u = float(inp[0]), inp[1]
    if u == 'JPY':
        result += x
    else:
        result += x * 380000.0
print(result)

Solution (Python):
import numpy

n = int(input())

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



print(sum)

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

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

print(sum_money)

Solution (Python):


N = int(input())

a = []

for i in range(N):
    a.append(input().split())

Y = 0

for figure, kind in a:

    if kind == 'JPY':
        Y += int(figure)
    else:
        figure = float(figure) * 380000.00000000
        Y += figure
print(Y)

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

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

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

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

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

print(sum)

Solution (Python):
c=0
for s in open(0).readlines()[1:]:n=float(s[:-4]);c+=n*380000*(s[-4]<'J')or n
print(c)

Solution (Python):

import sys

def io_generator():
	while True:
		yield raw_input()



def main(io):
	n=int(io.next())
	ret=0
	for _ in range(n):
		x,u=io.next().split()
		rate= 1 if u=='JPY' else 380000.0
		ret+=rate*float(x)
		
	return ret



if __name__ == "__main__":
	io=io_generator()
	print main(io)

Solution (Python):
N = int(input())
s = [input().split() for i in range(N)]
gift = []
for i in range(N):
    if s[i][1] =="JPY":
        gift.append(int(s[i][0]))
    if s[i][1] == "BTC":
        gift.append(float(s[i][0])*380000)
print(sum(gift))

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

Solution (Python):

btc = 380000.0
y = 0.0
for i in range(int(input())):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
         y += x * btc
    else:
        y += x

print(y)

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

total = 0
for i in range(N):
    a,b = map(str,input().split())
    if b == 'JPY':
        total += float(a)
    elif b == 'BTC':
        total += float(a)*380000

print(total)

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

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

Solution (Python):
c=0
for _ in[0]*int(input()):s=input();n=float(s[:-3]);c+=n*380000*(s[-3]<'J')or n
print(c)

Solution (Python):
n = int(input())
e = [[str(i) for i in input().split()] for i in range(n)]
sum = 0.0
for i in range(n):
    if(str(e[i][1]) == "BTC"):
        e[i][0] = 380000*float(e[i][0])
    else:
        e[i][0] = float(e[i][0])
    sum = sum + float(e[i][0])

print(sum)

Solution (Python):
c=0
for _ in[0]*int(input()):s=input();n=float(s[:-3]);c+=n*380000*(s[-3]<'J')or n
print(c)

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

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

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

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

    if money[1] == 'JPY':
        total += int(money[0])
    else:
        total += float(money[0])*380000

print(total)

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

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

Solution (Python):
from sys import stdin

n= int(stdin.readline().rstrip())
S = 0
for i in range(n):
  n = stdin.readline().rstrip().split()
  if n[1] == "JPY":
    S += int(n[0])
  else:
    S += float(n[0])*380000.0
    
print(S)

Solution (Python):
import re

n = input()
n = int(n)

sum = 0.

for i in range(1,n+1):
	line =input()
	li = line.split(" ")
	
	u = li[1]
	
	if u == 'JPY':
		sum += int(li[0])
	elif u == 'BTC':
		sum += float(li[0]) * 380000.0

print(sum)

Solution (Python):


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

def calc(wkX, wkU, Num) :
    total = 0
    for i in range(Num) :
        if wkU[i] == "JPY" :
            total += wkX[i]
        else :
            total = total + (wkX[i] * 380000.0)
    return total

print(calc(x, u, N))

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

sum = 0
for i in range(x):
    y = input().split(' ')
    if y[1] == 'JPY':
        sum += float(y[0])
    else:
        sum += float(y[0]) * 380000
print(sum)

Solution (Python):

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)

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

r = 380000.0

for i in range(0, n):
    sx, su = [i for i in input().split(" ")]
    x[i], u[i] = [float(sx), su]

y = [x[i] if u[i] == "JPY" else x[i] * r for i in range(0, n)]
print(sum(y))

Solution (Python):


if __name__ == "__main__":

    i = int(input())

    money = 0

    for j in range(i):

        j,k = map(str,input().split())

        kane = 0

        if k == 'JPY':
            kane = int(j)
        else:
            kane = float(j) * 380000.0

        money += kane

    print(money)

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

value = 0
for odama in odamas:
    if odama[1]=='JPY':
        value += int(odama[0])
    else:
        value += float(odama[0])*380000
print(value)

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

Solution (Python):
S = input()
X = 0.0
for a in range(int(S)):
   SA = input().split()
   if SA[1] == 'JPY':
      X += float(SA[0])
   else:
      X += float(SA[0])*380000
print(X)

Solution (Python):
a = int(input())
otoshidama=0
for x in range(a):
    b,c = map(str, input().split())
    if c=="JPY":
        otoshidama+=int(b)
    else:
        otoshidama+=float(b)*380000.0

print(otoshidama)

Solution (Python):
N=int(input().strip())
ans=0
grid=[]
for i in range(N):
    x=list(input().split())
    grid.append(x)
    if grid[i][1]=='JPY':
        ans+=float(grid[i][0])
    elif grid[i][1]=='BTC':
        ans+=float(grid[i][0])*380000.0
print(ans)

Solution (Python):

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.0

print(total)

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

btc_jpy_rate = 380000.0
jpy = []
btc = []
for i in range(N):
    amount, currency = map(str,input().split())
    amount = float(amount)
    if currency == 'JPY':
        jpy.append(amount)
    else:
        btc.append(amount)

otoshidama = sum(jpy) + sum(btc) * btc_jpy_rate
print(otoshidama)

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

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

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

Solution (Python):
def scale(unit):
    if unit == "JPY":
        scale = 1.0
    else:
        scale = 380000.0

    return scale


def normalize_money(money):
    _price, unit = money.split()
    price = float(_price)

    return price * scale(unit)


def solve(str_in_arr):
    moneys = str_in_arr[1::]
    normalized_money = [normalize_money(money) for money in moneys]

    return sum(normalized_money)

  
def main():
    _num_relative = input()
    num_relative = int(_num_relative)

    std_in = [num_relative if idx == 0 else input() for idx in range(num_relative+1)]
    print(solve(std_in))


if __name__ == "__main__":
    main()

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

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

for i in range(N):
  A = input().split()
  if A[1] == "JPY":
    total = total + float(A[0])
  if A[1] == "BTC":
    total = total + (float(A[0]) * 380000)

print(total)

Solution (Python):
b = 380000.0

s = 0
for _ in range(int(input())):
    l = input().split()
    if "JPY" == l[1]:
        s += int(l[0])
    else:
        s += float(l[0]) * b

print(s)

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

Solution (Python):

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

Solution (Python):
def func(A):
    if A[1] == "JPY":
        return float(A[0])
    else :
        return float(A[0]) * 380000.0
P = int(input())
sum = 0
for i in range(P):
    sum += func(input().split())
print(sum)

Solution (Python):
n = float(input())
i = 0
total = 0
while i < n:
  date = input().split()
  m = float(date[0])
  t = date[1]
  if date[1] == "JPY":
    total += m
  else:
    total += m * 380000
  i += 1
  
print(total)

Solution (Python):
import sys


def solution(nominals, currency):
    result = 0
    for value, c in zip(nominals, currency):
        if c =="JPY":
            result += value
        else:
            result += 380000.0 * value
    return result



nominals, currencies = [], []
for i,line in enumerate(sys.stdin):
    if i == 0:
        cases = int(line)
    else:
        n, c = line.split(' ')
        nominals.append(float(n))
        currencies.append(c.strip())

print(solution(nominals, currencies))

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

otoshidama=0.0
for i in range(n):
    inp=input().strip().split()
    x=float(inp[0])
    u=inp[1]
    if u=="JPY":
        otoshidama+=x
    elif u=="BTC":
        otoshidama+=x*380000.0
print(otoshidama)

Solution (Python):
n = list(map(int, input().split()))

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

yen = 0
btc = 380000
for row in list:
    if row[1] == 'JPY':
        yen += int(row[0])
    else:
        yen += float(row[0]) * btc

print(yen)

Solution (Python):


if __name__ == '__main__':

    N = int(input())
    otsdm = 0

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

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

    print(otsdm)

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

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

print(total)

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

print(1.0 * sum41)

Solution (Python):
n = int(input())
 
li = []
for i in range(n):
    li.append(list(input().split()))
 
 
for money in li:
    if money[1] == 'JPY':
        continue
    else:
        money[0] = float(money[0]) * 380000.0
 
sum_money = sum([float(i[0]) for i in li])
  
print(sum_money)

Solution (Python):
N = input().rstrip()
money = [input().rstrip().split(" ") for i in range(int(N))]
total = 0.0

for i in range(int(N)):
    if str(money[i][1]) == "BTC":
        total += float(money[i][0])*380000.0
    else:
        total += float(money[i][0])
print(total)

Solution (Python):
N = int(input())
a = []
sum = 0
for i in range(N):
    a.append(list(map(str, input().split())))
for i in range(N):
    if a[i][1] == "BTC":
        a[i][0] = 380000 * float(a[i][0])
    sum = sum + float(a[i][0])
print(sum)

Solution (Python):
import sys
s=0;input()
for e in sys.stdin:
 a,b=e.split()
 s+=int(a) if b=="JPY"else float(a)*380000
print(s)

Solution (Python):

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

print(ans)

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

for i in range(n):
    s.append(list(map(str,input().split())))
for i in range(n):
    s[i][0] = float(s[i][0])
for i in range(n):
    if s[i][1] == 'JPY':
        sum += s[i][0]
    elif s[i][1] == 'BTC':
        sum = sum + s[i][0] * 380000

print (sum)

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

Solution (Python):
c=0
for _ in[0]*int(input()):s=input();n=float(s[:-3]);c+=n*380000*(s[-3]<'J')or n
print(c)

Solution (Python):
btc=380000
N=int(input())
number=[0]*N
string=[0]*N
for i in range(N):
    list=input().split()
    number[i]=float(list[0])
    string[i]=list[1]

sum=0
for i in range(N):
    if string[i]=="JPY":
        sum=sum+number[i]
    else:
        sum=sum+number[i]*btc
print(sum)

Solution (Python):
n = int(input())
d = list([input().split() for i in range(n)])
y = 0
JPY = 0
BTC = 0
c = [0] * n

for i in range(n):
    if d[i][1] == 'BTC':
        c[i]= float(d[i][0])
        BTC += c[i] * 380000
    else:
        c[i]= int(d[i][0])
        JPY += c[i]
y = BTC + JPY
print(y)

Solution (Python):
BTC = 380000

N = int(input())
sum_otoshidama = 0

for n in range(N):
    otoshidama = input().split()
    if otoshidama[1] == 'BTC':
        sum_otoshidama += float(otoshidama[0])*BTC
    else:
        sum_otoshidama += float(otoshidama[0])

print(sum_otoshidama)

Solution (Python):
n = int(input())
sum = 0.0
box = []
a = []
b = []
for num in range(n):
  box = input().split(" ")
  a.append(box[0])
  b.append(box[1])
  if b[num] == "JPY":
    sum += float(a[num])
  else:
    sum += (float(a[num]) * 380000.0)

print(sum)

Solution (Python):
sum = 0

num = int(input())

for i in range(num) :
    money, currency = input().split()
    money = float(money)
    if currency == 'JPY' :
        sum += money
    else :
        sum += money * 380000

print(sum)

Solution (Python):
N = int(input())
otoshidama = []
otoshidama_sum = 0
for i in range(N):
    otoshidama.append(input().split())
for i in range(N):
    otoshidama[i][0] = float(otoshidama[i][0])
    if otoshidama[i][1] == 'BTC':
        otoshidama[i][0] = otoshidama[i][0]*380000
    otoshidama_sum += otoshidama[i][0]
print(otoshidama_sum)

Solution (Python):
n = int(input())
sum = 0.00
for i in range(n):
	price,format = input().strip().split(' ')
	price = float(price)
	if format == "BTC":
		price *= 380000
	sum += price
print(sum)

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

sum = 0.0
for _ in range(n):
	data = input().split()
	if data[1] == "JPY":
		sum += int(data[0])
	elif data[1] == "BTC":
		sum += float(data[0]) * 380000.0
		
print(sum)

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

Solution (Python):
c=0
for _ in[0]*int(input()):s=input();n=float(s[:-3]);c+=n*((s[-3:]>'C')or 380000)
print(c)

Solution (Python):


import sys

def parse_input(lines_as_string = None):

    lines = []
    if lines_as_string is None:
        lines.append(input())
        
        nm = lines[0].split(" ")
        n = int(nm[0])
        for i in range(n):
            lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]
        nm = lines[0].split(" ")
        n = int(nm[0])

    rows = []
    for i in range(1, n+1):
        fields = lines[i].split(" ")
        rows.append((float(fields[0]), fields[1]))

    return (n, rows)

def solve(n, rows):

    result = 0.0
    for i in range(n):

        money = rows[i][0]
        unit = rows[i][1]
        k = 1
        if unit == 'BTC':
             k = 380000.0

        result += k * money


    return result

def main():

    print("%f" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Solution (Python):
N = int(input())
money_JPY = 0
money_BTC = 0
sum = 0
for i in range(0,N,1):
  x, u = input().split()
  if str(u) == "BTC":
    money_BTC += float(x)
  else:
    money_JPY += int(x)
money_BTC = money_BTC*380000.0
sum = money_BTC+money_JPY
print(sum)

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

Solution (Python):


N = int(input())
ans = 0
for i in range(N):
    a = []
    a = input().split(" ")
    y = float(a[0])
    
    if a[1]=="BTC":
        k =y*380000
        ans +=k
    else:
        ans +=y
print(ans)

Solution (Python):
def main():
    N = int(input())
    count = 0.0
    for _ in range(N):
        x, u = input().split()
        if u == 'JPY':
            count += int(x)
        else:
            count += float(x)*380000
    print(count)

if __name__ == '__main__':
    main()

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

Y=0
for i in range(N):
    if u[i][1]=="JPY":
        Y+=float(u[i][0])
    else:
        Y+=float(u[i][0])*380000

print(Y)

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

sum = 0

for i in range(N):
    if (u[i] == 'JPY'):
        sum += x[i]
    elif (u[i] == 'BTC'):
        sum += x[i] * 380000
    else:
        break
print(sum)

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

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

xu_list = []
for i in range(N):
    if xu[i][1] == "JPY":
        xu_list.append(float(xu[i][0]))
    elif xu[i][1] == "BTC":
        xu_list.append(float(xu[i][0])*380000.0)

print(sum(xu_list))

Solution (Python):
n = int(input())
x,u = [0]*n,['0']*n
Otoshidama = 0
for i in range(n):
  a = input().split()
  x[i] = float(a[0])
  u[i] = a[1]
  if(u[i] == 'JPY'):
    Otoshidama += x[i]
  else:
    Otoshidama += (x[i] *  380000.0)

print(Otoshidama)

Solution (Python):
import numpy as np
N = int(input())
sum = 0
for i in range(N):
    x,u = input().split()
    if u == "BTC":
        sum += (float(x) * 380000.0)
    else:
        sum += float(x)
print(sum)

Solution (Python):
N = int(input())
X = []
U = []
for i in range(N):
    l = list(map(str, input().split()))
    U.append(l[1])
    if U[i] == 'JPY':
        X.append(int(l[0]))
    else:
        X.append(float(l[0]))

Y = 0.0
for n in range(N):
    if U[n]=='JPY':
        Y += X[n]
    else:
        Y += X[n] * 380000.0

print(Y)

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

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

Solution (Python):
c=0
for _ in[0]*int(input()):s=input();n=float(s[:-3]);c+=n*380000*(s[-3:]<'J')or n
print(c)

Solution (Python):
import sys

n = int(sys.stdin.readline().rstrip())

sum = 0
for i in range(n):
  line = sys.stdin.readline().rstrip().split(" ")
  if(line[1] == "BTC"):
    sum += float(line[0]) * 380000.0
  else:
    sum += float(line[0])
print(sum)

Solution (Python):
def main():
    n = int(input())
    sum = 0
    for _ in range(0, n):
        x, y = (j for j in input().split())
        if(y[0] == 'B'):
            sum += float(x)*380000
        else:
            sum += int(x)
    print(sum)

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
x = []
u = []
Y = 0
for i in range(N):
    s = [i for i in input().split()]
    x.append(float(s[0]))
    u.append(s[1])

    if u[i] == 'BTC':
        Y += x[i]*380000
    else:
        Y += x[i]

print(Y)

Solution (Python):
"""AtCoder"""

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

ans = 0

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

print(ans)

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

for _ in range(n):
    a = list(map(str, input().split()))
    if a[1] == "JPY":
        ans += float(a[0])
    else:
        ans += float(a[0]) * 380000

print(float(ans))

Solution (Python):
import sys

lines = sys.stdin.readlines()
N = int(lines[0])
XU = [n.split() for n in lines[1:]]

JPN = []
BTC = []
for xu in XU:
  if 'JPY' == xu[1]:
    JPN.append(float(xu[0]))
  else:
    BTC.append(float(xu[0]))

print(sum(JPN) + sum(BTC) * 380000.0)

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

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

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

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

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


if __name__ == "__main__":
    main()

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

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

print(sum)

Solution (Python):
n=int(input())
otosidama=0
for i in range(n):
  m = list(input().split())
  okane=float(m[0])
  if(m[1]=="BTC"):
    okane=okane*380000.0
  otosidama=otosidama+okane
print(otosidama)

Solution (Python):


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

print(ans)

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

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

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

Solution (Python):
n = int(input())
board = [input().split() for _ in range(n)]
base = 380000
result = 0

for xu in board:
  x,u = xu
  if u == 'BTC':
    result += base*float(x)
  else:
    result += int(x)

print(result)

Solution (Python):
N = input()
N = int(N)
x = []
v = []
Y = 0
for i in range(N):
    X,V = input().split()
    x.append(X)
    v.append(V)
for i in range(N):
    if v[i] == 'JPY':
        Y += int(x[i])
    elif v[i] == 'BTC':
        Y += 380000.0 * float(x[i])
print(Y)

Solution (Python):
import re
otoshidama = 0

N = int(input())

for i in range(0,N):
  ni = re.split('\s+', input())
  if(ni[1] == 'BTC'):
    otoshidama += (float(ni[0]) * 380000.00)
  else:
    otoshidama += int(ni[0])
  
print(otoshidama)

Solution (Python):
n=int(input())
l=[]
for i in range(n):
	a=list(map(str,input().split()))
	l.append(a)

x=[]
y=[]
for i in range(n):
	x.append(float(l[i][0]))
	y.append(l[i][1])
count_j=0
count_b=0
for i in range(n):
	if(y[i]=="JPY"):
		count_j+=x[i]
	elif(y[i]=="BTC"):
		count_b+=380000*x[i]

ans=count_j+count_b
print(ans)

Solution (Python):
"""
B - Digital Gifts
"""
import datetime

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

Solution (Python):






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





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





print(result)

Solution (Python):

N = int(input())

xu = []
for i in range(0, N):
    data = list(map(str, input().split()))
    xu.append(data)

for i in range(0, N):
    if(xu[i][1] == 'JPY'):
        xu[i][0] = int(xu[i][0])
    else:
        xu[i][0] = float(xu[i][0])*380000.0

money = []
for i in range(0, N):
    money.append(xu[i][0])

print(sum(money))

Solution (Python):
N=int(input())
x=[]
u=[]
s=0
for i in range(N):
    A,B=input().split()
    x.append(float(A))
    u.append(B)
for i in range(N):
    a=x[i]
    if u[i]=='JPY':
        s+=a
    else:
        s+=a*380000
print(s)

Solution (Python):
def main() -> None:
    N = int(input())
    yen = 0
    for _ in range(N):
        x, u = input().split()
        if u == 'JPY':
            yen = yen + int(x)
        elif u == 'BTC':
            yen = yen + (float(x) * 380000.0)

    print(yen)

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
listA=[]
listB=[]

for i in range(n):
    listA=input().split()
    if listA[1]=="BTC":
        listB.append(380000*float(listA[0]))
    else:
        listB.append(float(listA[0]))

print(sum(listB))

Solution (Python):
from decimal import Decimal

def solve():
	n = int(input())

	sum = Decimal("0")
	for i in range(n):
		amount, type = input().split()
		if type == "JPY":
			sum += Decimal(amount)
		else:
			sum += Decimal(amount)*Decimal("380000.0")
	return sum
	
	
print(solve())

Solution (Python):



N = int(input())
res = 0

for i in range(N):
    inp = input().split(' ')
    xi = float(inp[0])
    ui = inp[1]
    
    if ui == 'JPY':
        res += xi
    else:
        res += xi * 380000

print(res)

Solution (Python):
n = int(input())
xn = [input().split() for i in range(n)]
s = 0
for x in xn:
    if x[1] == "JPY":
        s += float(x[0])
    elif x[1] == "BTC":
        s += float(x[0]) * 380000.0

print(s)