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())
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())
sum = 0
for _ in range(n):
    x, u = input().split()
    if u =='JPY':
        sum+=(float(x))
    else:
        sum+=(float(x)*380000)
print("{:.5f}".format(sum))

Submission status: Accepted

Solution code:
n = int(input())
xu = [input().split() for i in range(n)]
for i in xu:
    i[0] = float(i[0])

for i in xu:
    if i[1] == 'BTC':
        i[0] *= 380000

print(sum(xu[i][0] for i in range(n)))

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)
    if U[i]=='BTC':
        X[i]=380000*X[i]
print(sum(X))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
Y = 0
unit = {'JPY':1.0, 'BTC':380000.0}
for _ in range(N):
    x, u = [s for s in input().split(' ')]
    Y += float(x) * unit[u]
print(Y)

Submission status: Accepted

Solution code:
N=int(input())
Amount=0
for i in range(N):
  a,u=input().split()
  if u=="JPY":
    unit=1
  else:
    unit=380000
  Amount+=float(a)*unit
print(Amount)

Submission status: Accepted

Solution code:
N = int(input())
x = []
sum = 0

for i  in range(N):
    x.append(list(map(str, input().split())))

for i in range(N):
    if x[i][1] == 'BTC':
        sum += float(x[i][0]) * 380000
    else:
        sum += float(x[i][0])

print(sum)

Submission status: Accepted

Solution code:
n = int(input())
a = [0] * n
b = [0] * n
s = 0
for i in range(n):
    a[i],b[i] = map(str, input().split())
    if b[i] == 'BTC':
        s += float(a[i]) * 380000.0
    s += float(a[i])

print(s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

def toYen(btc):
  return btc * 380000.0

N = int(stdin.readline().strip())
total = 0
for i in range(N):
  inp = stdin.readline().split()
  money, currency = float(inp[0]), inp[1]
  if currency == 'JPY':
    total += money
  else:
    total += toYen(money)
    
print(total)

Submission status: Accepted

Solution code:
BTC = 380000.0
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
amount = 0
for i in range(N):
	x,u = input().split()
	x = float(x)

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

print(amount)

Submission status: Accepted

Solution code:
N = int(input())

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

    if u == "JPY":
        yen = 1.0
    elif u == "BTC":
        yen = 380000.0
    sum += x * yen
    
print(sum)

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('{:.7f}'.format(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())
count = 0
xulist = []
for i in range(N):
    x, u = map(str,input().split())
    x = float(x)
    xulist.append([x,u])

for i in range(N):
    if xulist[i][1] == 'BTC':
        count += xulist[i][0] * 380000.0
    elif xulist[i][1] == 'JPY':
        count += xulist[i][0]

print(count)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
rate = 380000

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:
rate = {
	"JPY": 1.0,
	"BTC": 380000.0,
}

total = 0.0

for _ in range(int(input())):
	x, u = input().split()
	total += float(x) * rate[u]

print(total)

Submission status: Accepted

Solution code:
n = int(input())

bs = [input().split() for _ in range(n)]

ans = 0
for b in bs:
	if b[1] == "BTC":
		ans += float(b[0]) * 380000.0
	else:
		ans += float(b[0])
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
money=0

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

print(money)

Submission status: Accepted

Solution code:
def calcbtc(x):
	return int(380000*10000*x)
N = int(raw_input())
sum = 0
for i in range(0, N):
	gift = raw_input().split()
	if gift[1] == 'BTC':
		sum += calcbtc(float(gift[0]))
	else:
		sum += int(gift[0])*10000
print float(sum)/10000

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, x: "List[float]", u: "List[str]"):
    sum = 0.0
    for i in range(N):
        if u[i] == "JPY":
            sum += x[i]
        else:
            sum += x[i] * 380000
    print(sum)
    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]" 
    u = [str()] * (N)  # type: "List[str]" 
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    solve(N, x, u)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
money = 0

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

print(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_,*t=open(0);print(sum(38e4**('B'in s)*float(s[:-4])for s in t))

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
# 出力時の桁数を11桁くらいにする。    
print("{:.11f}".format(ans))

Submission status: Accepted

Solution code:
N = int(input())
otoshidama = 0
for i in range(N):
    pay,yen = input().split()
    pay = float(pay)
    if yen == 'JPY':
        otoshidama += pay
    else:
        otoshidama += pay*380000
        
print(otoshidama)

Submission status: Accepted

Solution code:
N = int(input())

X = [None] * N
U = [None] * N

total = 0.

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

print('{:.5f}'.format(total))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
xu_list = [input().split() for i in range(N)]

#print(N, xu_list)
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
m = [input().split() for _ in range(N)]
s = 0.0
for x,u in m:
  if u == "JPY":
    s += float(x)
  elif u == "BTC":
    s+= float(x) * 380000.0
print(s)

Submission status: Accepted

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

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)
  else:
    total += float(a) * 380000
print(total)

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

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

print(money)

Submission status: Accepted

Solution code:
N = int(input())
xu = [input().split() for i in range(N)]
print(sum([float(x) if u == 'JPY' else float(x)*380000.0 for x,u in xu]))

Submission status: Accepted

Solution code:
N = int(input())
xu = [input().split() for i in range(N)]
print(sum([float(x) if u == 'JPY' else float(x)*380000 for x,u in xu]))

Submission status: Accepted

Solution code:
n = int(raw_input())
x = []
u = []
total = 0
for i in range(n):
	xi, ui = map(str,raw_input().split())
	if ui == 'BTC':
		sumi = float(xi) * 380000.0
	else:
		sumi = float(xi)
	total += sumi

print total

Submission status: Accepted

Solution code:
N = int(input())
ans = 0.0
for i in range(N):
    mon, kind = input().split()
    mon = float(mon)
    if kind == 'BTC':
        mon = 380000.0 * mon
    ans += mon
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
m = 0.0
for _ in range(N):
	v, t = input().split()
	m += float(v) if t == 'JPY' else float(v) * 380000.0
print(m)

Submission status: Accepted

Solution code:
N=int(input())
T=[0]*N
mysum=0
for i in range(N):
    T[i]=[float(i) for i in input().replace("JPY","1").replace("BTC","380000").split()]
    mysum+=T[i][0]*T[i][1]
print(mysum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
x, u = [0] * N, [0] * N
for i in range(N):
    x[i], u[i] = input().split()
bsum, ysum = 0, 0
for i in range(N):
    if u[i] == 'BTC':
        bsum += float(x[i])
    else:
        ysum += float(x[i])
print(ysum + bsum * 380000)

Submission status: Accepted

Solution code:

N = int(input())

xu = [input().split() for _ in range(N)]
count = 0
for i in range(N):
    if xu[i][1] == 'JPY':
        count += int(xu[i][0])
    else:
        count += float(xu[i][0]) * 380000


print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
xu = [0]*N
for i in range(N):
    xu[i]=input().rstrip().split()



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


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)
    if u == 'BTC':
        ans += float(x) * 380000
print("%lf" % (ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
BTC = 380000.0
money = 0

for i in range(N):
  x,u = input().split()
  x = float(x)
  
  if u == "BTC":
    money += x*BTC
  elif u == "JPY":
    money += x

print(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
res = 0
for i in range(N):
    R = input().split()
    if R[1] == "BTC":
        res  = res + 380000 * float(R[0])
    else:
        res  = res + int(R[0])
print("{:.14f}".format(res))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
xu = [list(input().split()) for i in range(N)]
money = 0

for x, u in xu:
    if u == 'JPY':
        money += float(x)
    else:
        money += float(x) * 380000.0

print(money)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = int(input())
a = [list(input().split()) for i in range(N)]
res = 0
for x, u in a:
    x = float(x)
    if u=="JPY":
        res += x
    else:
        res += x*380000.0
print(res)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(N):
  xi,ui = input().split()
  if ui == "BTC":
    ans = ans + float(xi)*380000.0
  else:
    ans = ans + int(xi)
print(ans)

Submission status: Accepted

Solution code:
many = int(input())
sum_money = 0
for i in range(many):
    money, currency = map(str, input().split())
    if currency == 'JPY':
        sum_money += int(money)
    else:
        sum_money += 3.8e5 * float(money)

print(sum_money)

Submission status: Accepted

Solution code:
N = int(input())
xu = [input().split() for _ in range(N)]
t = 0
for x, u in xu:
    if u == 'JPY':
        t += int(x)
    else:
        t += float(x) * 380000
print(t)

Submission status: Accepted

Solution code:
N = int(raw_input())
total = 0
for n in range(N):
    x,u = raw_input().split()
    if u == 'JPY':
        total += int(x)
    else:
        total += float(x)*380000.0
print total

Submission status: Accepted

Solution code:
def gifts(li):
    if li[1] == "BTC":
        return float(li[0]) * 380000 
    else:
        return float(li[0])
n = int(input())
li_xu = []
sum = 0
for i in range(n):
    li_xu = input().split()
    sum += gifts(li_xu)
print(sum)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
BTC = 380000.0
total = 0

for _ in range(n):
    x, u = list(map(str, input().split(' ')))
    x = float(x)
    if u == 'JPY':
        total += x
    if u == 'BTC':
        total += (x * BTC)

print(total)

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:
# -*- coding: utf-8 -*-
import sys

def main():
	N = int(input());
	tama = []

	for _ in range(N):
		tmp = input().split(" ")
		x, u = tmp[0], tmp[1]
		tama.append((x, u))

	ans = 0
	for i in tama:
		x, u = i
		if u == "BTC":
			ans += float(x) * 380000
		else:
			ans += int(x)
	print(ans)

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
N = int(input())
Y = 0
for n in range(N):
  y, u = input().split()
  if u == 'JPY':
    Y += int(y)
  else:
    Y += float(y) * 380000.0
print(Y)

Submission status: Accepted

Solution code:
def BTCtoJPY(BTC):
    return BTC*380000.0

def main():
    accum = 0
    X = []
    N = int(input())
    for i in range(N):
        X.append(input().split())
    for i in X:
        if i[1] == "BTC":
            accum += BTCtoJPY(float(i[0]))
        else:
            accum += float(i[0])
    print(accum)

main()

Submission status: Accepted

Solution code:
N=int(input())
s=0
for i in range(N):
  l=list(input().split())
  if l[1]=="JPY":
    m=int(l[0])
  else:
    m=float(l[0])*380000
  s+=m
print(s)

Submission status: Accepted

Solution code:
N = int(input())

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

print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
XU = [list(input().split()) for _ in range(N)]
btc = 380000.0

summ = 0
for xu in XU:
    if xu[1] == 'BTC':
        summ += float(xu[0]) * btc
    else:
        summ += float(xu[0])

print(summ)

Submission status: Accepted

Solution code:
N = int(input())

sum_jpy = 0.0
sum_bit = 0.0
sum_all = 0.0
btc = 380000.0
for _ in range(N):
	x,u = map(str, input().split())
	if u == "JPY":
		sum_jpy += float(x)
	else:
		sum_bit += float(x)

sum_all = sum_jpy + btc * sum_bit

print(sum_all)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Digital Gifts
https://atcoder.jp/contests/abc119/tasks/abc119_b

"""
import sys


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


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
N=int(input())
P=0
for i in range(N) :
  A,B=input().split()
  if B=="JPY" :
    P+=int(A)  
  else :
    P+=float(A)*380000
print(P)

Submission status: Accepted

Solution code:
N = int(input())
xus = [[x for x in input().split()] for _ in range(N)]

ans = 0
for x, u in xus:
    if u == "JPY":
        ans += int(x)
    else:
        ans += 380000.0 * float(x)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
money = {'JPY': 0, 'BTC': 0.0}
for i in range(N):
    u, x = input().split()
    if x == "JPY":
        money['JPY'] += int(u)
    else:
        money['BTC'] += float(u)
print(money['JPY'] + money['BTC'] * 380000.0)

Submission status: Accepted

Solution code:
N = int(input())
X = [0] * N
U = [0] * N
sum = float(0)
for i in range(N):
    X[i], U[i] = input().split()
    X[i] = float(X[i])
    if U[i] == 'BTC':
        X[i] = X[i] * 380000.0
    sum = sum + X[i]
print(sum)

Submission status: Accepted

Solution code:
N = int(input())

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

print(total)

Submission status: Accepted

Solution code:
N=int(input())
a=[input().split() for _ in range(N)]
sum=0
for l in a:
    if l[1]=='JPY':
        sum+=float(l[0])
    else:
        sum+=float(l[0])*380000.0
print(sum)

Submission status: Accepted

Solution code:
def get_yen(x, u):
    if u == 'BTC':
        return x * 380000.0
    else:
        #uがyenの場合
        return x

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

sum = 0
for x, u in zip(X, U):
    sum = sum + get_yen(x, u)

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
XN_sum = 0
for i in range(N):
    X, U = [x for x in input().split()]
    if U == 'JPY':
        XN_sum += float(X)
    else:
        XN_sum += float(X) * 380000

print(XN_sum)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, x: "List[float]", u: "List[str]"):
    ret = 0
    for i in range(N):
        if u[i] == "JPY":
            ret += x[i]
        else:
            ret += 380000.0 * x[i]
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]" 
    u = [str()] * (N)  # type: "List[str]" 
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    solve(N, x, u)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(raw_input())
y = 0.0
for i in range(0,n):
    x, u = map(str, raw_input().split())
    if u == 'JPY': y += float(x)
    elif u == 'BTC': y += float(x) * 380000

print y

Submission status: Accepted

Solution code:
from datetime import datetime
n = int(input().rstrip())
l = [[i for i in input().split()] for i in range(n)]
total = 0
for v in l:
    if v[1] == "JPY":
        total += int(v[0])
    elif v[1] == "BTC":
        total += float(v[0]) * 380000.0
print(total)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    sum = 0
    for i in range(N):
        x,y = (_ for _ in input().split())
        if y == 'JPY':
            sum += float(x)
        elif y == 'BTC':
            sum += float(x) * 380000.0
    print(sum)

if __name__  == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
money = 0

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

N = int(input())

data = []

for i in range(N):
    price = input().split()
    data.append(price) 

total = 0

for i in range(N):
    if data[i][1] == "JPY":
        total += int(data[i][0])
    elif data[i][1] == "BTC":
        total += 380000 * float(data[i][0])

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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
  else:
    ans+=int(x)

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

print(sum)

Submission status: Accepted

Solution code:
N=int(input())


s=0
for i in range(N):
	x,u=input().split(" ")
	s+=(u=="JPY")*float(x)+(u=="BTC")*380000.0*float(x)
print(s)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0.0
for i in range(N):
  a, b = input().split()
  if b == 'JPY':
    ans += float(a)
  else:
    ans += float(a)*380000
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

BTC_RATE = 380000.0

N = int(stdin.readline().rstrip())


xu_list = [[x for x in stdin.readline().rstrip().split()] for _ in range (N)]

sum_num = 0
for x, u in xu_list:
    x = float(x)
    if u == "JPY":
        sum_num += x
    else:
        sum_num += x * BTC_RATE

print(sum_num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
money = [input().split() for _ in range(n)]
jpy_money = [int(i[0]) if i[1] == 'JPY' else float(i[0]) * 380000.0 for i in money]
print(sum(jpy_money))

Submission status: Accepted

Solution code:
N = int(input())

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


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

sum = 0
for i in range(N):
    li = []
    li = list(input().split())
    #print(li)
    if(str(li[1]) == "JPY"):
        sum += float(li[0])
    elif(str(li[1]) == "BTC"):
        sum += float(li[0])*380000

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(s)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

ans=0

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

    if money[1]=="JPY": ans+=float(money[0])
    else: ans+=float(money[0])*380000.0

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ttl = 0

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

print(ttl)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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