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.



Sample input:
2
10000 JPY
0.10000000 BTC


Sample output:
48000.0

Submission status: Accepted

Solution code:
n = int(input())
Y = 0
for i in range(n):
  a, b = input().split()
  if b == "BTC":
    a = float(a) * 380000
  Y += float(a)
print(Y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0.0
for _ in range(n):
    x, u = input().split()
    k = 1
    if u != "JPY":
        k = 380000
    ans += k * float(x)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
rate = 380000.0
ans = 0.0
for i in range(N):
    x, u = input().split()
    x = float(x)
    ans += x * rate if u == "BTC" else x
print("{:.11f}".format(ans))

Submission status: Accepted

Solution code:
N = int(input())

x = []
u = []
sum_m = []

for i in range(N):
    j, k = input().split(' ')
    if k == 'JPY':
        sum_m.append(int(j))
        x.append(int(j))
    elif k == 'BTC':
        sum_m.append(float(j) * 380000.0)
        x.append(float(j))
    u.append(k)

print(sum(sum_m))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
n = int(input())
f = 0
k = 0
a = []
for i in range(n) :
    a = input().split()
    if a[1] == "JPY" :
        f +=  float(a[0])
    else :
        k += float(a[0])
print(f + k *380000 )

Submission status: Accepted

Solution code:
N = int(input())
rate = 380000.0
ans = 0.0
for _ in range(N):
    x, u = input().split()
    x = float(x)

    ans += x * (rate if u == 'BTC' else 1)
print('{:.11f}'.format(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(sum([float(x)*{"JPY":1,"BTC":380000}[u] for i in range(int(input())) for x,u in ([input().split()])]))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
N = int(raw_input())
total = 0
for i in range(N):
    xi_, ui = raw_input().split()
    if ui == 'JPY':
        xi = int(xi_)
        total += xi
    else:
        xi = float(xi_)
        total += 380000.0 * xi
print total

Submission status: Accepted

Solution code:
N = int(input())

x = []

for _ in range(N):
  inp = input().split(' ')
  if inp[1] == 'JPY':
    x.append(int(inp[0]))
  else:
    x.append(float(inp[0]) * 380000.0)


sum = 0

for i in range(N):
  sum += x[i]

print(sum)

Submission status: Accepted

Solution code:
a = int(input())
total = 0
for _ in range(a):
    i = input()
    v,c = i.split()
    v = float(v)
    if(c=="BTC"):
        v *= 380000
    total += v
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a=int(input())
    
b=[]   

c=0.0
    

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

Submission status: Accepted

Solution code:
JP = 0
BC = 0.0

N = int(input())

for i in range(0,N):
    mon, rate = input().split()
    if (rate == "JPY"):
        JP += int(mon)
    else:
        BC += float(mon)
sum = JP + 380000.0 * BC
print(sum)

Submission status: Accepted

Solution code:
n,*a=open(0).read().split();f=float;print(sum([f(a[s])*380000.0,f(a[s])][a[s+1]=="JPY"]for s in range(0,int(n)*2,2)))

Submission status: Accepted

Solution code:
n,*a=open(0).read().split();print(sum([float(a[s])*380000.0,float(a[s])][a[s+1]=="JPY"] for s in range(0,int(n)*2,2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i=0
sum =0
N=int(input())

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

    sum += x

print(sum)

Submission status: Accepted

Solution code:
a = int(input())

b = []

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

res = 0

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

print(res)

Submission status: Accepted

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

ss=[]
for i in range(N):
    if a[i][1] == 'JPY':
        ss.append( float(a[i][0]))
    elif a[i][1] == 'BTC':
        ss.append(float(a[i][0])*380000.0)

print(sum(ss))

Submission status: Accepted

Solution code:
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest119-B
#  TODO https://atcoder.jp/contests/abc119/tasks/abc119_b

def solveProblem(personNumber):
	sumPrice = 0.0
	personRange = range(0,personNumber,+1)
	for _ in personRange:
		price,kahei = map(str,input().strip().split(' '))
		if(kahei == "BTC"):
			floatPrice = float(price)
			sumPrice = sumPrice + 380000.0 * floatPrice
		else:
			intPrice = float(price)
			sumPrice = sumPrice + intPrice
	answer = sumPrice
	return answer


if __name__ == '__main__':
	N = int(input().strip())
	solution = solveProblem(N)
	print("{}".format(solution))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
m = 0
for i in range(N):
    x, y = map(str, input().split())
    x = float(x)
    if y == "BTC":
        m += x * 380000.0
    else:
        m += x
print(m)

Submission status: Accepted

Solution code:
N = int(input())
s = [input() for i in range(N)]

count =0

for i in range(N):

    BTCindex =  s[i].find("BTC")
    if BTCindex != -1:
        BTC_strip = ((s[i]).strip("BTC"""))
        count +=(float(BTC_strip)*380000.0)
    
    JPYindex =  s[i].find("JPY")
    if JPYindex != -1:
        JPY_strip = ((s[i]).strip("JPY"""))
        count +=(float(JPY_strip))


print(count)

Submission status: Accepted

Solution code:

def B():
    jpy='JPY'
    btc='BTC'
    rate_from_btc_to_jpy=380000

    N = int(input())
    x_list=[]
    u_list=[]
    for i in range(N):
        x, u = (x for x in input().split())
        x = float(x)
        x_list.append(x)
        u_list.append(u)
    
    otoshidama = 0
    for i in range(len(u_list)):
        if u_list[i] == jpy:
            otoshidama = otoshidama + x_list[i]
        elif u_list[i] == btc:
            otoshidama = otoshidama + x_list[i] * rate_from_btc_to_jpy
    
    print(otoshidama)

if __name__== '__main__':
    B()

Submission status: Accepted

Solution code:
N = int(input())
xu = [list(map(str,input().split())) for i in range(N)]

Ans = []

for i in range(N):
    if xu[i][1] == "JPY":
        Ans.append(int(xu[i][0]))
    else:
        Ans.append(float(xu[i][0]) * 380000)

print(sum(Ans))

Submission status: Accepted

Solution code:
total = 0

relatives = int(input())
input_array = [input() for i in range(relatives)]

for input_string in input_array:
  price_type = input_string.split()
  if price_type[1] == 'JPY':
    total += float(price_type[0])
  else:
    total += float(price_type[0]) * 380000
    
print(total)

Submission status: Accepted

Solution code:

n = int(input())

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
BTCIN = 'BTC'
BTCTAN = 380000.0
inNinzu = int(input())
okaneList = [[0 for i in range(2)] for j in range(inNinzu)]
okaneAns = 0.0
for i in range(0, inNinzu):
    inOkane = input().split(' ')
    if inOkane[1] == BTCIN:
        okaneAns += float(inOkane[0]) * BTCTAN
    else:
        okaneAns += float(inOkane[0])

print(okaneAns)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
list = []
for i in range(N):
  a, b = input().split()
  list1 = [a, b]
  list.append(list1)
 
sum = 0.0
bin = 0.00000000
for i in range(len(list)):
  if list[i][1] == "JPY":
    sum += float(list[i][0])
  else:
    bin += float(list[i][0])
all = sum + (bin * 380000.0)
print(all)

Submission status: Accepted

Solution code:
a = int(input())
i = 0
b = []
for i in range(a):
    b.append(input().split())

money_bit_all = 0
money_all = 0

for i in range(a):
    money_bit = 0
    if 'BTC' in b[i]:
        money_bit = 380000.0 * float(b[i][0])
        money_bit_all = money_bit_all + money_bit

    else:
        money_all = money_all + float(b[i][0])

print(money_all + money_bit_all)

Submission status: Accepted

Solution code:
x=[]
u=[]
sum=0
n=int(input())
for i in range(n):
    tmp=input().split()
    x.append(float(tmp[0]))
    u.append(tmp[1])

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

print(sum)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import math
import bisect
import random
def LI(): return list(map(int, input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return list(input())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
mod = 1000000007

#A
"""
s = input().split("/")
if int(s[0]) > 2019:
    print("TBD")
elif int(s[0]) == 2019:
    if int(s[1]) > 4:
        print("TBD")
    elif int(s[1]) == 4:
        if int(s[2]) > 30:
            print("TBD")
        else:
            print("Heisei")
    else:
        print("Heisei")
else:
    print("Heisei")
"""

#B
n = I()
ans = 0
for i in range(n):
    x,u = input().split()
    x = float(x)
    if u == "JPY":
        ans += x
    else:
        ans += x*380000.0
print(ans)
#C
"""
n,a,b,c = LI()
l = IR(n)
f = [True for i in range(3)]
ans = 0
for i in range(n):
    for d in range(3):
        if abs(l[i]-[a,b,c][d]) <= 10 and f[d]:
            ans += abs(l[i]-[a,b,c][d])
            f[d] = False
            l[i] = -float("inf")
k = False
for i in f:
    if i:
        k = True
        break
if not k:
    print(ans)
    quit()
"""
#D
"""
a,b,q = LI()
s = IR(a)
t = IR(b)
for i in range(q):
    x = I()
    c = bisect.bisect_left(s,x)
    ans = float("inf")
    k = abs(x-s[c-1])
    y = s[c-1]
    d = bisect.bisect_left(t,y)
    ans = min(ans,k+abs(y-t[d-1]))
    if d < b:
        ans = min(ans,k+abs(y-t[d-1]),min(abs(x-s[c-1]),abs(t[d]-x))+abs(t[d]-s[c-1]))
    ans = min(k,ans)
    if c < a:
        k = abs(x-s[c])
        y = s[c]
        d = bisect.bisect_left(t,y)
        if d == b:
            if t[-1] < x:
                k = min(s[c]-x,x-t[d-1])+s[c]-t[d-1]
        else:
            if abs(y-t[d-1]) < abs(y-t[d]):
                if t[d-1] < x:
                    k = min(s[c]-x,x-t[d-1])+s[c]-t[d-1]
            else:
                k += abs(y-t[d])
        ans = min(k,ans)
    print(ans)
"""
#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

print(sum)

Submission status: Accepted

Solution code:
n=int(input())
x=[]
u=[]
for i in range(n):
    y,z=input().split()
    x.append(y)
    u.append(z)
v=0
for i in range(n):
    if u[i]=='JPY':
        v+=int(x[i])*1
    else: 
        v+=float(x[i])*380000
print(v)

Submission status: Accepted

Solution code:
s = input()
money = 0
for i in range(int(s)):
  str_money = input()
  temp = str_money.split(" ")
  if temp[1] == "JPY":
    money += float(temp[0])
  else:
    money += 380000.0 * float(temp[0])
print(money)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from sys import stdin

N = input()
total = 0
for i in range(int(N)):
  x, u = stdin.readline().rstrip().split() 
  if u=='JPY':
    total=float(x)+total
  else:
    total += float(380000*float(x))
      
print('%f'%total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    line_num = int(sys.stdin.readline().strip())
    sum_total = 0.0
    for i in range(line_num):
        line = sys.stdin.readline().strip()
        qua, cur = line.split(" ")
        if cur == "BTC":
            sum_total += 380000.0 * float(qua)
        else:
            sum_total += float(qua)
    print(sum_total)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

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 !!
#
solve(lines)

Submission status: Accepted

Solution code:
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))))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
import numpy

n = int(input())
#m = list(map(int, input().split()))
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

print(sum_money)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# Digital Gifts

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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:

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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
#coding:utf-8

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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:

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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)