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())
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:
XU=list(input().split() for i in range(int(input())))
print(sum([float(x)*{"JPY":1,"BTC":380000}[u] for x,u in XU]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for _ in range(n):
    value, typ = input().split()

    if typ == 'JPY':
        ans += int(value)
    else:
        ans += float(value) * 380000

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
i_l=[]
k_l=[]
for a in range(n):
    i = input().split()
    if i[1]=='BTC':
        i_l.append(float(i[0]))
    else:
        k_l.append(int(i[0]))

q=sum(k_l)
print(sum(i_l)*380000+q)

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())
x = [list(map(str, input().split())) for _ in range(N)]
tmp = []
for i in range(N):
    if x[i][1] == 'JPY':
        tmp.append(float(x[i][0]))
    else:
        tmp.append(float(x[i][0]) * 380000)
print(sum(tmp))

Submission status: Accepted

Solution code:
"""#################################################################
【ABC119】
B - Digital Gifts
#################################################################"""

#インポート
import sys

#入力用
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def SS(): return sys.stdin.readline().rstrip().split()
def S(): return sys.stdin.readline().rstrip()

sum = 0
N = II()
for i in range(N):
    x, y = SS()
    if y == "JPY":
        sum += float(x)
    else:
        sum += float(x)*380000
print(sum)

Submission status: Accepted

Solution code:
n = int(input())

otc = []
for _ in range(n):
    x, u = input().split()
    otc.append((x, u))

score = 0
for x, u in otc:
    if u == "JPY":
        score += float(x)
    if u == "BTC":
        score += 380000 * float(x)

print(score)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(t)

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

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
rate = 380000
for i in range(n):
    money ,kind = input().split()
    if kind == "JPY":
        sum += int(money)
    else:
        sum += float(money) * rate
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for n in L:
    ans += float(n[0]) * 380000.0 if n[1] == 'BTC' else float(n[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 += int(x)
    else:
        ans += 380000.0*float(x)
print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

BTC_EXCHANGE_RATE = 380000

money = 0
for _ in range(n):
    x, u = input().split()
    x = float(x)
    money += [x, x*BTC_EXCHANGE_RATE][u == 'BTC']

print(money)

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=0
for xu in xus:
  if xu[-1]=='JPY':
    ans+=float(xu[0])
  else:
    ans+=380000.0*float(xu[0])
print(ans)

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
o=[]
bit=0
jp=0
for i in range(n):
    o.append(input().split())
    if o[i][1]=='BTC':
        bit+=float(o[i][0])
    else:
        jp+=int(o[i][0])
print(jp+380000*bit)

Submission status: Accepted

Solution code:
N = int(input())

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

print(Answer)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
x = [0] * N
u = [0] * N
for i in range(N):
	x[i], u[i] = input().split()

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

Submission status: Accepted

Solution code:
N = int(input())
kingaku = []
tanni = []

otoshidama = 0.0
for i in range(N):
    k, t = input().split()
    if t == 'BTC':
        otoshidama += float(k) * 380000.0
    else:
        otoshidama += int(k)

print(otoshidama)

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

Submission status: Accepted

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

for i in range(n):
    x,y = input().split()
    if y == 'JPY':
        ans += float(x)
    else:
        ans += float(x) * 380000.0

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

for j in range(n):
  if xu[j][1] == "BTC":
    s += float(xu[j][0])*380000
  else:
    s += float(xu[j][0])
    
print(s)

Submission status: Accepted

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

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + float(xu[j][0])*380000
  else:
    sigma = sigma + float(xu[j][0])
    
print(sigma)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

btc = []
yen = []

for i in range(N):
  x,y = map(str,input().split())
  if y == "JPY":
    yen.append(float(x))
  else:
    btc.append(float(x))

print(sum(btc)*380000.0 + sum(yen))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

ans = 0
for i in range(N):
    if li[i][1] == "JPY":
        ans += float(li[i][0])
    elif li[i][1] == "BTC":
        ans += float(li[i][0]) * 380000.0

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
money=0
for _ 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())
a = 0
for _ in range(n):
    x, n = input().split()
    a += (38*10**4)**(n == 'BTC')*float(x)
print(a)

Submission status: Accepted

Solution code:
n=int(input())

jpy=[]
btc=[]

for i in range(n):
    x,u=input().split()
    if u=="JPY":
        jpy.append(float(x))

    else:
        btc.append(float(x)*380000.0)

#print(jpy)
#print(btc)

print(sum(jpy)+sum(btc))

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = float(x) * 3.8e5
  count += x
print(count)

Submission status: Accepted

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

    return tot

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
otoshidama = {"JPY":0, "BTC":0}
for i in range(n):
    a, b = map(str, input().split())
    a = float(a)
    if b == "JPY":
        otoshidama["JPY"] = otoshidama["JPY"] + a
    else:
        otoshidama["BTC"] = otoshidama["BTC"] + a
ans = otoshidama["JPY"] + otoshidama["BTC"] * 380000.0
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - Digital Gifts(ABC119)
N=int(input())
X=[]
U=[]
s=0
for i in range(N):
    x,u=map(str, input().split())
    X.append(float(x))
    U.append(u)
for i in range(N):
    if U[i]=="JPY":
        s+=X[i]
    else:
        s+=X[i]*380000.0
print(s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
ans=0
for n in range(N):
    x,y = input().split()
    if y == "JPY":
        ans+=float(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 = (i for i in input().split())
    if u == "JPY":
        ans += int(x)
    else:
        ans += float(x) * 380000

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
money = []
measure = []
for _ in range(n):
  mo,me = input().split()
  money.append(float(mo))
  measure.append(me)
for i in range(n):
  if measure[i]=='BTC':
    money[i] *= 380000.0
print(sum(money))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
x=[]
u=[]
for n in range(N):
  X,U=input().split()
  if "." in X:
    X=float(X)
  else:
    X=int(X)
  x.append(X)
  u.append(U)
s=[]
for i in range(N):
  if u[i]=="JPY":
    s.append(x[i])
  elif u[i]=="BTC":
    s.append(x[i]*380000.0)
print(sum(s))

Submission status: Accepted

Solution code:
n = int(input())
otoshidama = []
for i in range(n):
	a = list(input().split())
	a[0] = float(a[0])
	otoshidama.append(a)

def calc_value(l):
	if l[1] == "BTC":
		l[0] = 380000.0 * l[0]
	return l[0]
	
total = 0
for i in range(n):
	total += calc_value(otoshidama[i])

print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
xu=[list(map(str, input().split())) for _ in range(N)]
total=0
for i in range(N):
    if xu[i][1]=='JPY':
        total+=float(xu[i][0])
    else:
        total+=380000.0*float(xu[i][0])
print(total)

Submission status: Accepted

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

Submission status: Accepted

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

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())
l=[input().split() for i in range(n)]
for i in range(n):
  if l[i][1]=="JPY":
    l[i][1]=1
  else:
     l[i][1]=380000
print(sum(float(l[i][0])*l[i][1] for i in range(n)))

Submission status: Accepted

Solution code:
N=int(input())

sum=0

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

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
money = 0
for i 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())
t = 0
for i in range(n):
    x, v = map(str, input().split())
    if v == "JPY":
        t += float(x)
    else:
        t += float(x) * 380000
print(t)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for _ in range(N):
    i = input().split()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = int(input())

list = []
for _ in range(S):
  num, currency = input().split()
  d = {num: currency}
  list.append(d)

sum = 0
for l in list:
  for k, v in l.items():
    if v == 'JPY':
      sum += int(k)
    else:
      k = float(k)
      sum += k * 380000
print(sum)

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())
ans = 0
for i 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())
xu = [[i for i in input().split()] for i in range(n)]
ans = 0
for i in range(n):
    if xu[i][1]=='JPY':
        ans += float(xu[i][0])
    else:
        ans += float(xu[i][0])*380000
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

print(val)

Submission status: Accepted

Solution code:
n = int(input())
t = [list(input().split()) for _ in range(n)]
BY = 380000
ans = 0

for i in range(n):
    if t[i][1] == 'JPY':
        ans += int(t[i][0])
    else:
        ans += float(t[i][0])*BY

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
sum = 0.0
for i in range(N):
  K = input().split()
  if K[1] == "BTC":
    sum += float(K[0])*380000
  else:
    sum += int(K[0])
print(sum)

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

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

print(sum)

Submission status: Accepted

Solution code:
n=int(input())

total=0.0
for i in range(n):
  a,u=input().split()
  a=float(a)
  if u=='JPY':
    total+=a
  else:
    total+=a*380000
print(total)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    xu = [list(input().split()) for _ in range(n)]
    total = 0
    for x, u in xu:
        if u == "BTC":
            total += float(x) * 380000
        else:
            total += float(x)
    return total


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
import math
import copy

inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# inputb = input().split()
# inputbint = [int(x) for x in inputb]
# inputList = list(b)

# x = int(inputb[0])
# y = int(inputb[1])

inputList=[]
for i in range(a):
    inputNum = input().split()
    # inputNum = [float(x) for x in inputNum]
    inputList.append(inputNum)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

sum = 0
btc2jpy = 380000.0
for i in range(a):
    tmp = float(inputList[i][0])
    if str(inputList[i][1]) == "JPY":
        sum += tmp
    else:
        sum += btc2jpy * tmp

print(sum)

Submission status: Accepted

Solution code:
n=int(input())
c=0
for i in range(n):
    y=input().split()
    if y[1]=="JPY":
        c+=float(y[0])
    else:
        c+=float(y[0])*380000.0

print(c)

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:
sum = 0.0
n = int(input())
for i in range(n):
    x, u = map(str, input().split())
    if u == 'JPY':
        sum += int(x)
    elif u == 'BTC':
        sum += 380000.0 * float(x)
print(sum)

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())
values = [input().split() for i in range(n)]
print(sum([float(value) * {'JPY':1,'BTC':38e4}[unit]for value,unit in values]))

Submission status: Accepted

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

ans = 0

for j in range(N):
    if list[j][1] == "JPY":
        ans += list[j][0]
    else:
        ans += 380000 * list[j][0]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
x = []
y = []
for i in range(n):
    a, b = map(str, input().split(' '))
    if b == 'BTC':
        x.append(float(a)*380000)
    else:
        x.append(float(a))
print(sum(x))

Submission status: Accepted

Solution code:
n = int(input())
xu = list(list(map(str,input().split())) for _ in range(n))

answer = 0
for i in range(n):
    if xu[i][1] == 'JPY':
        answer += int(xu[i][0])
    else:
        answer += float(xu[i][0])*380000

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ll = [input().split() for _ in [0]*n]
ans = 0.0
for l in ll:
  if l[1] == 'BTC':
    ans += float(l[0])*380000
  else:
    ans += float(l[0])
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

# input
N = int(input())

# solve
ans = 0
for i in range(N):
    x, u = map(str, input().split())
    if u == 'JPY':
        ans += int(x)
    if u == 'BTC':
        ans += 380000.0 * float(x)

# output
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

#format関数 .桁数fで小数点以下が指定できる
print("{:.11f}".format(ans))