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 _ in range(N):
    x, u = input().split()
    x = float(x)
    ans += x if u == 'JPY' else x * 380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a=380000.0
for i in range(n):
    if xu[i][1]=="JPY":
        total+=float(xu[i][0])
    else:
        total+=float(xu[i][0])*a
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0.0
for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        ans += float(x)
    elif u == 'BTC':
        ans += float(x) * 380000
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy
n = int(input())
x = []
u = []
for i in range(n):
    a, b = input().split()
    x.append(float(a))
    u.append(b)

sum = 0
for i in range(n):
    if u[i] == "JPY":
        sum += x[i]
    else:
        sum += x[i]*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
    else:
        ans+=int(x)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
inp = sys.stdin.buffer.readline

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

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

Submission status: Accepted

Solution code:
N = int(input())
su = 0
for i in range(N):
  s = input()
  x = float(s[:-4])
  if s[-3:] == "JPY":
    su += x
  else:
    su += x*380000
    
print(su)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    ans = 0
    for _ in range(int(input())):
        a, b = input().split()
        a = float(a)
        if b == 'JPY':
            ans += a
        elif b == 'BTC':
            ans += a * 380000
    print('%.10f' % ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    ans = 0
    n = ii()
    for _ in range(n):
        x, u = input().split()
        x = float(x)
        if u == 'JPY':
            ans += x
        else:
            ans += 380000 * x
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
x= [""]*(N+1)
u= [""]*(N+1)

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

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

  
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')
# ----------------------------------------------------------- #

n = I()
ans = 0
for i in range(n):
    x, u = Ss()
    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()
    x = float(x)
    if u == "JPY":
        ans += x
    elif u == "BTC":
        ans += x * 380000
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
l=[]
while n>0:
    s,y=map(str,input().split())
    if y=='JPY':
        k=int(s)
        l.append(k)
        n-=1
    else:
        j=float(s)*380000
        l.append(j)
        n-=1
print(sum(l))

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

Submission status: Accepted

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

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)
    X=""
    U=""
#print(x)
#print(u)
sum=0
for i in range(n):
    if u[i]=="JPY":
        sum+=x[i]
    elif u[i]=="BTC":
        sum+=x[i]*380000.0
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for i 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
a = 0,1
for i in range(n):
    a,b = input().split()
    if b == "BTC":
        a = float(a)*380000
        ans += a
    else:
        ans += int(a)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for n in range(N):
  x, t = input().split()
  if t == "BTC":
    ans += float(x)*380000.0
  else:
    ans += float(x)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, x: "List[float]", u: "List[str]"):
    rate = 380000.0
    print(sum(xi * (rate if ui == "BTC" else 1.0) for xi, ui in zip(x, u)))


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())
l = []
b = int(380000)
t = 0

for i in range (N):
  l.append(list(map(str, input().split())))
  
for j in range (N):
  
  if l[j][1] == "BTC":
    t += float(l[j][0])*b
    
  else:
    t += float(l[j][0])
    
print(t)

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

Submission status: Accepted

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

JPY = [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY']
BTC = [float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC']

print(sum(JPY) + sum(BTC))

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    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)
resolve()

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(n):
    s = input().split()
    if s[1]=="JPY":
        ans+=int(s[0])
    elif s[1]=="BTC":
        x = float(s[0])
        ans+=x*380000
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 += float(x)
    else:
        sum += float(x)*380000
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+=float(a)
    else:
        ans+=float(a)*380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools

n = int(input())
dic = {"JPY":0, "BTC":0}
for i in range(n):
    l = list(input().split())
    if l[1] == 'JPY':
        dic["JPY"] += float(l[0])
    if l[1] == 'BTC':
        dic["BTC"] += float(l[0])

print(dic["JPY"] + 380000*dic["BTC"])

Submission status: Accepted

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

ans = 0
for money in moneies:
    if money[1] == "JPY":
        ans += int(money[0])
    else:
        ans += float(money[0]) * 380000
print(ans)

Submission status: Accepted

Solution code:
cost = 0
n = int(input())
for _ in [0] * n:
    s = input().split()
    x, u = float(s[0]), s[1]
    if u == "BTC":
        cost += x * 38e4
    else:
        cost += x
print(cost)

Submission status: Accepted

Solution code:
n=int(input())

b=380000
res=0

for _ in range(n):
	x,u=input().split()
	x=float(x)
	if u=="BTC":
		x*=b
	res+=x
	
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = []
for i in range(N):
  x, u = list(input().split())
  x = float(x)
  if u == "BTC":
    x = 380000.0*x
  a.append(x)
  
print(sum(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

otosidama = 0.0
bit = 380000
for i in range(n):
    x, v = input().split()

    if v == 'JPY':
        otosidama += float(x)
    else:
        otosidama += float(x) * bit
print(otosidama)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N = int(input())
XU = [tuple(input().split()) for _ in range(N)]

ans = 0
for x,u in XU:
    if u == "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 = 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()
    if u=="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 = map(str,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()
    if u == 'BTC':
        money += float(x)*380000
    else:
        money += int(x)
print(money)

Submission status: Accepted

Solution code:
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########
def main(n,l):
    res = 0
    for x,u in l:
        res += calc(x,u)
    return res
    
def calc(x,u):
    return int(x) if u == "JPY" else float(x) * 380000

n = ii()
l = list([input().split() for _ in range(n)])
print(main(n,l))

Submission status: Accepted

Solution code:
n = int(input())
money = 0
for _ in range(n):
  p = input().split()
  if p[1] == 'JPY':
    money += int(p[0])
  elif p[1] == 'BTC':
    money += float(p[0]) * 380000

print(money)

Submission status: Accepted

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

print(total)

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC119B

n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    x,u = input().split()
    x = float(x)
    if(u == 'JPY'):s += x
    elif(u == 'BTC'):s += x * 380000
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n=I()
ans=0
for i in range(n):
    u=input().rstrip().split(" ")
    a=float(u[0])
    s=u[1]
    if s=="JPY":
        ans+=a
    else:
        ans+=a*380000
print(ans)

Submission status: Accepted

Solution code:
# B - Digital Gifts

N = int(input())
ans = 0
xrate = 380000

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def solve():

    N = int(input())
    xlist = []

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

    print(sum(xlist))


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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())
 
ans = 0
for i in range(n):
    l = input().split()
    if l[1] == "BTC":
        ans += float(l[0])*380000
    else:
        ans += int(l[0])

print(ans)

Submission status: Accepted

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

for i in range(n):
    if xu[i][1] == 'JPY':
        sum_xu += xu[i][0]
    elif xu[i][1] == 'BTC':
        sum_xu += xu[i][0]*380000.0

print(sum_xu)

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())
total = 0
for i in range(N):
  x,u=input().split()
  total = total + float(x) * [1,380000.0][u=="BTC"]
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
x = list()
u = list()

for a in range(0, N):
    X, U = input().split()
    x.append(float(X))
    u.append(U)

sm = 0

for a, b in zip(x, u):
    if b == 'BTC':
        sm += a*380000
    else:
        sm += a

print(sm)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
x_y = [list(input().split()) for _ in range(n)]
ans = 0
for i in range(n):
    if x_y[i][1] == "JPY":
        ans+=float(x_y[i][0])
    else:
        ans+=float(x_y[i][0])*380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def digital_gifts(n, xuli):

    ans = 0

    for i in xuli:
        if i[1] == "JPY":
            ans += float(i[0])
        else:
            ans += float(i[0])*380000

    return ans

def main():
    n = int(input())
    xuli = [list(map(str, input().split())) for i in range(n)]
    print(digital_gifts(n, xuli))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for _ in range(n):
    m,t = input().split()
    m = float(m)
    if t == 'JPY':ans+=m
    else:ans+= m*380000.0
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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
xu = [input().split() for _ in range(N)]
ans = 0

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

print(ans)

Submission status: Accepted

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


for a, b in zip(X, U):
    if b == "BTC":
        result.append(380000 * a)
    else:
        result.append(a)

print(sum(result))

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)