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

n = int(input())
money = []
sum = 0
for i in range(0,n):
    money.append(input().split())
for i in money:
    if i[1] == "JPY":
        sum += float(i[0])
    else:
        sum += float(i[0]) * 380000.0
print(sum)

Submission status: Accepted

Solution code:
n=int(input())
xu=[]
for i in range(n):
    xu1=input().split()
    xu.append(xu1)
BTC=[]
JPY=[]
for j in xu:
    if j[1]=='BTC':
        BTC.append(float(j[0]))
    else:
        JPY.append(int(j[0]))
print(380000.0*sum(BTC)+sum(JPY))

Submission status: Accepted

Solution code:
n = int(input())
summm = 0.0

for i in range(n):
    xu = list(map(str, input().split()))
    if xu[1] == "JPY":
        summm = summm + float(xu[0])
    else:
        summm = summm + float(xu[0]) * 380000.0

print(summm)

Submission status: Accepted

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

for i in range(N):
  tmp = input().split()
  x = tmp[0]
  u = tmp[1]
  
  if u == 'JPY':
    sum += int(x)
  else:
    sum += float(x) * 380000.0

print(sum)

Submission status: Accepted

Solution code:
n = int(input())
otosidama_list=[]
ans = 0
for i in range(n):
        otosidama_list.append(input().split(" "))
#print(otosidama_list)
for j in range(n):
        otosidama_list[j][0] = float(otosidama_list[j][0])
        if otosidama_list[j][1] == "JPY":
                ans += otosidama_list[j][0]
        elif otosidama_list[j][1] == "BTC":
                ans += otosidama_list[j][0] * 380000.0
print(ans)

Submission status: Accepted

Solution code:
#配列を定義
#JPY bit の定義
N = int(input())
#x,y = [], []
S = 0
for i in range(N):
    x_t,y_t = list(input().split())
    #x.append(x_t)
    #y.append(y_t)
    if y_t == "JPY":
        S += int(x_t)
    else:
        S += float(x_t)*380000.0
print(S)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def int_raw():
    return int(raw_input())
 
def words_raw():
    return raw_input().split()

BTC_TO_JPY = 380000.0
N = int_raw()
sum = 0.0
for _ in range(N):
	present, currency = words_raw()
	if currency == 'JPY':
		sum += int(present)
	else:
		sum += float(present) * BTC_TO_JPY
print sum

Submission status: Accepted

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

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

Submission status: Accepted

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

for _ in range(n):
  x, u= input().split()
  if u == "JPY":
    kane +=int(x)
  elif u == "BTC":
    kane += 380000.0*float(x)
    
print(kane)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ファイルをオープンする
#test_data = open("test.txt", "r")

# 行ごとにすべて読み込んでリストデータにする
#line = test_data.readline()


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

print(sum)

Submission status: Accepted

Solution code:
N = int(input())

sum = 0

JPY = 1
BTC = 380000.0

for _ in range(N):
    money, style = map(str, input().split())
    if style == 'JPY':
        sum += float(money) * JPY
    else:
        sum += float(money) * BTC

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
coin = []
index = 0
cash = 0
man = 1
answer = 0.0
while(N > 0):
    j = [i for i in input().split()]
    coin.append(j)
    coin[index][cash] = float(coin[index][cash])
    index += 1
    N -= 1
index -= 1
while(index >= 0):
    if(coin[index][man] == "JPY"):
        answer += float(coin[index][cash])
    else:
        answer += float(coin[index][cash]) * 380000.0
    index -= 1
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input().strip())

xus = [input().split() for i in range(0,N)]

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

print(sum)

Submission status: Accepted

Solution code:
sum_gift = 0
Gift_lists = []
N = int(input())
for i in range(0, N):
    Gift_lists.append([x.strip() for x in input().split()])

for l in Gift_lists:
    if l[1]=='JPY':
        sum_gift += int(l[0])
    else:
        sum_gift += float(l[0])*380000.0
print(sum_gift)

Submission status: Accepted

Solution code:
number = int(input())
price = []
for i in range(number):
	price.append(input().split(" "))
jpy = 0
btc = 0
for i,j in price:
	if j == "JPY":
		jpy += float(i)
	else:
		btc += float(i)
print(jpy + btc*380000)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(total)

Submission status: Accepted

Solution code:
N = int(input())
gift = []

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

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

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
otoshidama = []
for _ in range(N):
    [a, b] = input().split()                                                                                   
    otoshidama.append([float(a), b])

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
x=[]
w=[]

tot=0.0
for i in range (n):
	ip=input()
	ip=ip.split()
	x.append(float(ip[0]))
	w.append(ip[1])
#print(x)
for i in range (n):
	if(w[i]=="JPY"):
		tot+=x[i]
	else:
		tot+=(x[i]*380000.0)

print(tot)

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())
A = []
sum = 0

for i in range(N) : 
    a, b = input().split()
    A.append((a, b))
    
for i in range(N) : 
    if A[i][1] == "JPY" : sum += float(A[i][0])
    else : sum += float(A[i][0])*380000.0

print(sum)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input()) #input -> str
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())
total = 0
for i in range(n):
    inp = input().split()
    x, u = float(inp[0]), inp[1]
    if u=='JPY':
        total += x
    else:
        total += 380000.0*x
        
print(total)

Submission status: Accepted

Solution code:
# 入力
N = int(input())
x, u = zip(*((float(t[0]), t[1]) for t in (input().split() for _ in range(N))))

# 定義通り計算
ans = sum(
    t[0] if t[1] == 'JPY' else
    380000 * t[0] for t in zip(x, u)
)

# 出力
print(ans)

Submission status: Accepted

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

for i in range(N):
    if x_u[i][1] == "JPY":
        otoshidama.append(eval(x_u[i][0]))
    else:
        otoshidama.append(eval(x_u[i][0])*380000.0)
        
print(sum(otoshidama))

Submission status: Accepted

Solution code:
# Digital Gifts
N = int(input().strip())

sum = 0
for n in range(N):
	S = input().strip().split()
	xn = float(S[0])
	un = S[1]
	if un == 'JPY':
		sum += xn
	elif un == 'BTC':
		sum += 380000*xn

print(sum)

Submission status: Accepted

Solution code:
n = int(input())
x = []
y = []
for _ in range(n):
  i, j = input().split()
  x.append(float(i))
  y.append(j)
print(sum([x[i] if y[i] == "JPY" else x[i]*380000 for i in range(n)]))

Submission status: Accepted

Solution code:
#encoding:utf-8

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())
a=[]
b=[]
for i in range(N):
  x,y=input().split()
  a.append(float(x))
  b.append(y)
total=0
for j in range(N):
  if b[j]=='JPY':
    total += a[j]
  else:
    total += 380000.0*a[j]
print(total)

Submission status: Accepted

Solution code:
N = int(input())
rs = []
jys = []
for _ in range(N):
    r,jy=input().split()
    rs.append(float(r))
    jys.append(jy)
sum_r = 0
for i in range(len(rs)):
    if jys[i] == 'JPY':
        sum_r += rs[i]
    else:
        sum_r += 380000 * rs[i]
print(sum_r)

Submission status: Accepted

Solution code:
N=input()
#ABK=list(map(int,input().split()))
sum=0
for i in range(int(N)):
 xu=list(input().split())
 if xu[1]=="JPY":
   sum=sum+int(xu[0])
 else:
   sum=sum+380000*float(xu[0])

print(sum)

Submission status: Accepted

Solution code:
N=int( input() )
#XU= []
X=[]
for i in range(N):
    x,u = input().split() # x: 100 u: JPY
    if u=="JPY":
        x=float(x)
    else:
        x=float(x)
        x=x*380000
    #XU.append( [x, u] )
    X.append(x)

print(sum(X))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
res = 0
for i in range(n) :
  value, unit = input().split()
  if(str(unit) == 'BTC') : res += float(value) * 380000
  else : res += float(value)
print(res)

Submission status: Accepted

Solution code:
n = int(input())
otosidama = float(0)

for i in range(n):
    x,y = map(str,input().split())
    x = float(x)
    if y == "JPY" :
        otosidama = otosidama + x
    else:
        otosidama = otosidama + x * 380000.0

print(otosidama)

Submission status: Accepted

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

Y = 0
for i in X:
    if i[1] == 'JPY':
        Y += int(i[0])
    elif i[1] == 'BTC':
        Y += (380000.0 * float(i[0]))

print(Y)

Submission status: Accepted

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

for i in range(0,N):
  A,B=(input().split(" "))
  AA=float(A)
  if B=="BTC":
    AA=AA*380000
  
  OTOSHIDAMA+=AA
  #print(OTOSHIDAMA)
  
print(OTOSHIDAMA)

Submission status: Accepted

Solution code:
x=[]
u=[]
n=int(input())
for i in range(n):
    a,b=map(str,input().split())
    x.append(float(a))
    u.append(b)
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:
RATE = 380000.0;
N = int(input());

sum = 0;
for i in range(N):
    s = input().split(" ");
    if s[1] == "BTC":
        sum = sum + float(s[0])*RATE;
    else:
        sum = sum + float(s[0]);

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

m = 0

g = []

for i in range(n):
    g.append(list(input().split()))

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

print(m)

Submission status: Accepted

Solution code:
N = int(input())
JPY,BTC = [],[]
for i in range(N):
    X,Y = input().split()
    if Y == 'JPY':
        JPY.append(float(X))
    else:
        BTC.append(float(X))
ans = sum(JPY) + sum(BTC) * 380000
print(ans)

Submission status: Accepted

Solution code:
line = int(input())

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

Submission status: Accepted

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


def solve(N: int, x: "List[float]", u: "List[str]"):
    ret = 0

    for xi, ui in zip(x, u):
        if ui == "JPY":
            ret += xi
        else:
            ret += 380000.0 * xi
    print(ret)


# 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())
d = {"JPY":0, "BTC":0}
for i in range(N):
    x,u = map(str,input().split())
    d[u] += float(x)
print(d["JPY"]+d["BTC"]*380000)

Submission status: Accepted

Solution code:
d = {"JPY":1, "BTC":380000}
s = 0
for _ in [0]*int(input()):
  x,u = input().split()
  s += float(x)*d[u]
print(s)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

answer = 0
for i in range(N):
    x_cand, u_cand = input().split()

    x_cand = float(x_cand)
    u_cand = str(u_cand)

    if u_cand == "JPY":
        answer += x_cand
    elif u_cand == "BTC":
        answer += x_cand * 380000.0

print(answer)

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+= 380000.0 * x

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = []

for i in range(N):
  x,y = input().split()
  a.append([x,y])

ans = 0
for i in a:
  if i[1] == "JPY":
    ans += int(i[0])
  elif i[1] == "BTC":
    ans += float(i[0]) * 380000

print(ans)

Submission status: Accepted

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

sum = 0
for i in range(len(a)):
    currency = a[i][1]
    if currency == 'JPY':
        sum += int(a[i][0])
    else:
        sum += float(a[i][0]) * 380000.0
print(sum)

Submission status: Accepted

Solution code:
# S = input()
# print('Heisei' if S <= '2019/04/30' else 'TBD')

# n,m,c=map(int,input().split())
# b=list(map(int,input().split()))
# e = [[int(i) for i in input().split()] for i in range(n)]

# array=[None]*3
# print(array)

n=int(input())
total=0.0
i=n
while i>0:
	x,u=map(str,input().split())
	x=float(x)
	if u=="JPY":
		total+=x
	elif u=="BTC":
		total+=x*380000.0
	i-=1

print(total)

Submission status: Accepted

Solution code:
###B - Digital Gifts
n = int(input())
kanezuru = []
summoney = 0
for i in range(n):
    x, u = input().split()
    kanezuru.append([float(x), u])

for i in range(n):
    if kanezuru[i][1] == 'BTC':
        kanezuru[i][0] *= 380000.0
    summoney+= kanezuru[i][0]

print(summoney)

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())
x = 0
u = 0
for i in range(N):
    a, b = input().split(" ")
    if (b == "JPY"):
        x += int(a)
    else:
        u += float(a) * 380000.0
print(x+u)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces

n = ni()
ans = 0
for i in range(n):
  a,c = nn()
  r = 1 if c == "JPY" else 380000
  ans += float(a)*r

print(ans)

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int, x: "List[float]", u: "List[str]"):
    ans = 0
    for y, v in zip(x, u):
        if v == "JPY":
            ans += y
        else:
            ans += y*380000
    print(ans)
    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())
btc = 380000
money = 0
for _ in range(N):
  x, y = input().split()
  if(y == "BTC"):
    money += float(x)*btc
  else:
    money += int(x)
print(money)

Submission status: Accepted

Solution code:
n = int(input())
 
otoshidamas = []
kingaku = 0
for i in range(n):
  otoshidamas.append(input().split())
  
for item in otoshidamas:
  if item[1] == "JPY":
    kingaku += float(item[0])
  else:
    kingaku += float(item[0]) * 380000.0
 
print(kingaku)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
l = []
total = 0
for i in range(n):
    l.append(list(input().split()))
for i in range(n):
    if l[i][1] == 'JPY':
        total += float(l[i][0])
    else:
        total += float(l[i][0]) * 380000
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.0
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
data = list(map(lambda x:(float(x[0]),x[1]),[input().split() for i in range(n)]))
print(sum([i[0] for i in data if i[1] == 'JPY'])+sum([i[0] for i in data if i[1] == 'BTC'])*380000.0)

Submission status: Accepted

Solution code:
def jpybtc(s):
    rate = 0
    if s == "JPY": 
        rate = 1.0 
    elif s == "BTC": 
        rate = 380000.0 
    return rate
    
n = int(input())
x = [0]*(n+1)
u = [0]*(n+1)
#print(x)
#print(u)

for i in range(1,n+1):
    x[i], u[i] = input().split()
x = list(map(float,x))
v = list(map(jpybtc,u))
#print(x)
#print(v)
sum = 0
for j in range(1,n+1):
    sum = sum + x[j] * v[j]
print(sum)

Submission status: Accepted

Solution code:
BTC = 380000.0
sum_money = 0.0

N = int(input())
for _ in range(N):
    amount, which = input().split()
    amount = float(amount)
    if (which=='BTC'):
        amount = amount*BTC
    sum_money += amount

print(sum_money)

Submission status: Accepted

Solution code:
n = int(input())

sum_yen = 0.0

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

    if u == 'JPY':
        sum_yen += int(x)
    else:
        sum_yen += float(x) * 380000.0

print(sum_yen)

Submission status: Accepted

Solution code:
N = int(input())

JP = [0]
BTC = [0]

for _ in range(N):
    L = input().split()
    if L[1] == "JPY":
        JP.append(float(L[0]))
    else:
        BTC.append(float(L[0]))
print(sum(JP) + sum(BTC) * 380000)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1, N + 1):
    xi, ui = input().split()
    xi = float(xi)
    if ui == 'JPY':
        ans += xi
    else:
        ans += xi * 380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
X, U = ['' for _ in range(N)], ['' for _ in range(N)]
for n in range(N):
    X[n], U[n] = input().split()

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

print(otoshidama)

Submission status: Accepted

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

for i in range(N):
  xi, ui = input().split()
  u.append(ui)
  if ui == "BTC":
    x.append(float(xi)*380000)
  else:
    x.append(float(xi))

print(sum(x))

Submission status: Accepted

Solution code:
N=int(input())
s=0
for _ 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:
N=int(input())
s=0
for _ 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:
N = int(input())

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

Submission status: Accepted

Solution code:
c = int(input())

total = 0
for i in range(0,c):
  k,v = map(str, input().split())
  if(v == "JPY"):
    total += int(k)
  else:
    total += float(k) * 380000 
print(total)

Submission status: Accepted

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

# データ数の取込み
NN = int( input() )
total = 0
bitcoin = 380000.0
for ii in range( NN ) :
    money, currency_type = input().split()
    # print( ii, money, currency_type)
    if currency_type == "JPY" :
      total += int( money )
    elif currency_type == "BTC" :
      yen = float( money ) * bitcoin
      total += yen
else:
  print( total )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0.0
for k in range(N):
    x, u = 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):
    xi, ui = input().split()
    if ui == 'JPY':
        ans += int(xi)
    else:
        ans += float(xi) * 380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

jp = float(0)
bi = float(0)

for n in range(0,N):
  inp = input().split()
  x = float(inp[0])
  u = str(inp[1])

  if u == "JPY":
    jp += x
  elif u == "BTC":
    bi += x

print(float(jp + (bi*380000.0)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#親戚の数
relatives = int(input())

#ビットコインの合計
BTC = 0.0

#日本円の合計
JPY = 0

#お年玉判定
Currency = ''
amount = ''

#合計金額
total = 0.0

for i in range(relatives):
  amount, Currency = map(str,input().split())

#日本円の合計額をJPYに格納する。
  if Currency == 'JPY':
    JPY += int(amount)

#ビットコインの合計量をBTCに格納する。
  elif Currency == 'BTC':
    BTC += float(amount)

#ビットコインを日本円にし、日本円の合計額を計算する。
total = JPY + 380000.0 * float(BTC)

print(total)

Submission status: Accepted

Solution code:
n = int(input())
res = 0
for i in range(n):
    x,u = map(str,input().split())
    x = float(x)
    if u=="JPY":
        res += x
    else:
        res += x*(38*10**4)
else:
    print(res)

Submission status: Accepted

Solution code:
#coding:utf-8

if __name__ == "__main__":
    num = int(input())
    money = []
    mtype = []
    for p in range(num):
        m_tmp, mt_tmp = input().split()
        money.append(float(m_tmp))
        mtype.append(mt_tmp)
    
    total = 0
    for m, mt in zip(money, mtype):
        if mt == "JPY":
            total += m
        else:
            total += m * 380000.0
    
    print(total)

Submission status: Accepted

Solution code:
N = int(input())
x_u = [input().split() for _ in range(N)]
x_u = [(float(i[0]), i[1]) for i in x_u]

result = 0
for x, u in x_u:
    if u == "JPY":
        result += x
    else:
        result += x * 380000.0

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

result = 0
for x in e:
    if x[1] == "JPY":
        result += float(x[0])
    else:
        result += float(float(x[0])*380000)

print(result)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    res = 0.0
    for _ in range(n):
        x, u = input().split()
        if u == "JPY":
            res += int(x)
        else:
            res += float(x) * 380000
    print(res)


if __name__ == "__main__":
    main()