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())
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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
A = [[x for x in input().rstrip().split()] for _ in range(N)]
ans = 0
for i in A:
    if i[1] == "JPY":
        ans += int(i[0])
    else:
        ans += 380000 * float(i[0])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(n):
    if ls_xu[i][1] == "BTC":
        ls_xu[i][0] = float(ls_xu[i][0]) * 380000
    else:
        ls_xu[i][0] = float(ls_xu[i][0])
    ans += ls_xu[i][0]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

otoshidama = 0.0
for _ in range(n):
  money, unit = input().split()
  otoshidama += float(money) * (380000 if unit == "BTC" else 1)

print(otoshidama)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from decimal import Decimal,ROUND_HALF_UP
def print_ans(N, ar):
    """Test Case
    >>> print_ans(2, [["10000", "JPY"],["0.10000000", "BTC"]])
    48000.0
    >>> print_ans(3, [["100000000", "JPY"],["100.00000000", "BTC"],["0.00000001", "BTC"]])
    138000000.0038
    """
    ans = 0.0
    for a in ar:
        if a[1] == 'BTC':
            ans += float(Decimal(str(float(a[0]) * 380000.0)).quantize(Decimal('0.00001'), rounding=ROUND_HALF_UP) )
        else:
            ans += float(a[0])
    print(ans)


if __name__ == '__main__':
    N = int(input().rstrip())
    ar = [input().rstrip().split() for _ in range(N)]
    print_ans(N, ar)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def examB():
    N = I()
    bit = 0; yen = 0
    for _ in range(N):
        x, u = LSI()
        if u=="JPY":
            yen +=float(x)
        else:
            bit +=float(x)
    ans = bit*380000 + yen
    print(ans)


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
btc = 380000.0
def is_float(s):
  try:
    float(s)
  except:
    return False
  return True
def get_f(a):
  if is_float(a):
    return float(a)
  else:
    return(a)
fortune = [list(map(get_f,input().split())) for _ in range(n)]
jpy = [f[0] for f in fortune if f[1] == "JPY"]
bit = [f[0] for f in fortune if f[1] == "BTC"]
bit = list(map(lambda x:x*btc,bit))
print(sum(jpy)+sum(bit))

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
xl=[];ul=[]
for i in range(n):
  x,u=map(str,input().split())
  #print(x)
  xl.append(float(x))
  ul.append(u)
#print(xl)
btc=380000.0
ans=0.0
for i in range(n):
  if ul[i]=="BTC":
    ans+=xl[i]*btc
  else:
    ans+=xl[i]
print('{:.7f}'.format(ans))

Submission status: Accepted

Solution code:

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def divisor(n):
    """
    n の約数をリストで返す
    :param int n:
    :rtype: list of int
    """
    ret = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ret.append(i)
            if n // i != i:
                ret.append(n // i)
    return ret

def MI(): return map(int, input().split())


def main():
    N = int(input())
    BTC = 380000.0
    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import os, sys, re, math

N = int(input())

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
XUs = []
w = 0.0
for n in range(N):
    x, u = [s for s in input().split(' ')]
    w += float(x) if u == 'JPY' else float(x) * 380000.0
    XUs.append((x, u))

print(w)

Submission status: Accepted

Solution code:
import os, sys, re, math

N = int(input())

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

print (total)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0.0
for i in range(n):
  m, t = list(input().split(' '))
  m = float(m)
  if t == 'BTC':
    m *= 380000.0
  ans += m
print(ans)

Submission status: Accepted

Solution code:
ret = 0
for _ in range(int(input())):
    val, type = input().split()
    if type[0] == 'J':
        ret += float(val)
    else:
        ret += float(val) * 380000
print(ret)

Submission status: Accepted

Solution code:
A = int(input())
p = 0
for a in range(A):
  x = list(input().split())
  if x[1] == 'BTC':
    p = p + 380000.0 * float(x[0])
  else:
    p = p + int(x[0])
print(p)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

Y = 0
for _ in range(N):
    t = input().split()
    x = float(t[0])
    u = t[1]
    if u == 'JPY':
        Y += x
    elif u == 'BTC':
        Y += x * 380000.0
print(Y)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in range(n):
    if ls_xu[i][1] == 'JPY':
        ans += float(ls_xu[i][0])
    elif ls_xu[i][1] == 'BTC':
        ans += float(ls_xu[i][0]) * 380000

print(ans)

Submission status: Accepted

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

for i in range(n):
  a, b = input().split()
  if b == "JPY":
    sum += float(a)
  else:
    sum += float(a) * 380000

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

cnt =0

for i in range(N):
    if list_aaa[i][1] =="JPY":
        cnt += int(list_aaa[i][0])
    elif list_aaa[i][1] =="BTC":
        cnt += float(list_aaa[i][0])*380000.0
print(cnt)

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())
ret = 0
for _ in range(N):
  val, dat = input().split()
  val = float(val)
  if dat == "JPY":
    ret += val
  else:
    ret += 380000 * val
print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#テストファイルで実行する時
import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


n = int(input())
lists = [input().split() for i in range(n)]

#print(lists)

ans = 0

for i in range(n):
	if lists[i][1] == 'JPY':
		ans = ans + float(lists[i][0])
	else:
		ans = ans + float(lists[i][0])*380000
		
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 += int(x)
    else: ans+= float(x) * 380000.0



print(ans)

Submission status: Accepted

Solution code:
N, *xu = open(0).read().split()
X = list(map(float,xu[::2]))
U = xu[1::2]

sum_=0
for x, u in zip(X, U):
  if u == 'JPY':
    sum_+=x
  else:
    sum_+=x * 380000
print(sum_)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
money = []
for _ in range(n) :
    xi, yi = input().split()
    xi = float(xi)
    if yi == "JPY" :
        xi = xi
    elif yi == "BTC" :
        xi = xi * 380000.0
    money += [xi]
print(sum(money))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import Decimal
N = int(input())
X = []
btc_rate = Decimal("380000.0")
for _ in range(N):
    x, u = list(input().split())
    X.append([Decimal(str(x)), u])

ans = 0
for i in range(N):
    amount = X[i][0]
    unit = X[i][1]
    if unit == 'JPY':
        ans += amount
    else:
        ans += btc_rate * amount

print(ans)

Submission status: Accepted

Solution code:
# ABC 119: B – Digital Gifts
n = int(input())

x = []
u = []

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

total_otoshidama = 0

for i in range(n):
    if u[i] == 'BTC':
        total_otoshidama += x[i] * 380000
    else:
        total_otoshidama += x[i]

print(total_otoshidama)

Submission status: Accepted

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

for i in range(n):
    tmp = list(map(str, input().split()))
    if tmp[1] == 'JPY':
        total+=float(tmp[0])
    else:
        total+=float(tmp[0])*380000
        
print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
lst = [list(input().split()) for row in range(N)]

btc_to_jpy = 380000.0
total_value = 0
i = 0
while i < N:
	value = float(lst[i][0])
	if lst[i][1] == 'JPY':
		total_value += value
	else:
		total_value += value * btc_to_jpy
	i = i + 1
print(total_value)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
# 2019-11-12 16:33:33(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    n = int(sys.stdin.readline().rstrip())

    otoshidamas = []
    for _ in range(n):
        x, u = sys.stdin.readline().split()
        x = float(x)
        otoshidamas.append([x, u])
    
    total = 0
    for i in range(n):
        if otoshidamas[i][1] == 'JPY':
            total += otoshidamas[i][0]
        else:
            total += otoshidamas[i][0] * 38e4
    
    print(total)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def func1(lst, value): return [i for i, x in enumerate(lst) if x == value]
def func2(coping, lst, coefficient=1):return sum(lst[i] * coefficient for i in coping)
lst = [input().split(' ') for i in range(int(input()))]
X = [float(i[0]) for i in lst]
Y = [i[1] for i in lst]
print(func2(func1(Y,"BTC"),X,380000.0) + func2(func1(Y,"JPY"),X))

Submission status: Accepted

Solution code:
def func1(lst, value): return [i for i, x in enumerate(lst) if x == value]
def func2(coping, lst, coefficient=1):return sum(lst[i] * coefficient for i in coping)

lst = [input().split(' ') for i in range(int(input()))]
X = [float(i[0]) for i in lst]
Y = [i[1] for i in lst]

print(func2(func1(Y,"BTC"),X,380000.0) + func2(func1(Y,"JPY"),X))

Submission status: Accepted

Solution code:
def func1(lst, value):
    return [i for i, x in enumerate(lst) if x == value]

X,Y = [],[]
ans = 0

N = int(input())
for i in range(N):
    x,y = input().split(' ')
    X.append(float(x))
    Y.append(y)

btc = func1(Y,"BTC")
jpy = func1(Y,"JPY")

for i in btc:

    ans = ans + (X[i] * 380000.0)

for i in jpy:
    ans = ans + X[i]

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

Submission status: Accepted

Solution code:
n =  int(input())

list = []
for _ in range(n):
    a,b = input().split()
    if b == "JPY":
        list.append(int(a))
    else:
        a = 380000.0 * float(a)
        list.append(a)
print(sum(list))

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

for i in range(n) :
    digit, unit = map(str, input().split())
    if unit == 'JPY' :
        ans += float(digit)
    else :
        ans += float(digit) * 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())
A=[0]*N
B=['0']*N
count=0
for i in range(N):
  A[i],B[i]=input().split()
for i in range(N):
  if B[i]=='BTC':
    count+=float(A[i])*380000.0
  else:
    count+=float(A[i])
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
l = []
ans = 0
for i in range(N):
  l.append(list(map(str, input().split())))
  l[-1][0] = float(l[-1][0])

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

Submission status: Accepted

Solution code:
n = int(input())
print(sum(float(x) * 38e4 ** (int(u == "BTC")) for x, u in [input().split() for _ in range(n)]))

Submission status: Accepted

Solution code:
n = int(input())
print(sum(float(x) * (int(u == "BTC") * 379999 + 1) for x, u in [input().split() for _ in range(n)]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
N = int(input())
x = np.zeros(N)
u = []
for i in range(N):
  xx, uu = input().split()
  x[i] = float(xx)
  u.append(uu)

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

print(sum)

Submission status: Accepted

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

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

main()

Submission status: Accepted

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

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())
drop_ball = [ input().split() for _ in range(N) ]

money = 0
for x, u in drop_ball:
  if u == "JPY":
    money += float(x)
  else:
    money += float(x) * 380000

print(money)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
  if group[i][1]=="JPY":
    count += int(group[i][0])
  else:
    count += float(group[i][0])*380000.0
print(count)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
li = [list(stdin.readline().rstrip().split()) for _ in range(n)]

total = 0.0

for i in range(n):
    if li[i][1] == "BTC":
        total += float(li[i][0])*380000
    else:
        total += float(li[i][0])

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for val in range(n):
    x,u = map(str,input().split())
    if u == "JPY":
        tanni = 1.0
    else:
        tanni = 380000.0
    ans = ans + tanni * 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 == "BTC": x *= 380000
	ans += x

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())  
x = []
u = []
price=[]
for i in range(N):
    x1,y1=[i for i in input().split()]
    x.append(float(x1))
    u.append(y1)

for j in range(N):
    if u[j]=='BTC':
        price.append(x[j]*380000.0)
    else:
        price.append(x[j])

print(sum(price))

Submission status: Accepted

Solution code:
# = map(int, input().split())
n = int(input())
# = input()
# = list(map(int, input().split()))

to = 0
for i in range(n):
	x, u = map(str, input().split())
	if u == "JPY":
		to += int(x)
	elif u == "BTC":
		to += float(x)*380000

print(to)

Submission status: Accepted

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

for i in range(N):
    x,y=input().split()
    M = float(x)
    if y=='JPY':
        ans+=M
    else :
        ans+=M*380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
X = []
U = []
count = 0

for _ in range(N):
    x, u = map(str, input().split())
    X.append(float(x))
    if u == 'JPY':
        U.append(1)
    else:
        U.append(380000)

for n in range(N):
    count += X[n] * U[n]

print(count)

Submission status: Accepted

Solution code:
N = int(input())

ret = 0
for _ in range(N) :
    x, u = input().split()
    x = float(x)

    if u == 'JPY' :
        ret += x
    else :
        ret += x * 380000
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#2019/10/21
N, *x = [list(s.split()) for s in open(0)]
# print(N, x)
sum = 0
for i, j in x:
    if (j == 'JPY'):
        sum += float(i)
    else:
        sum += float(i)*380000
print(sum)

Submission status: Accepted

Solution code:
N = int(input())

total = 0

for i in range(N):
	X = list(input().split())
	X[0] = float((X[0]))
	if X[1] == "BTC":
		X[0] = X[0] * 380000

	total += X[0]
	
print(total)

Submission status: Accepted

Solution code:
n = int(input())
ans = []
for _ in range(n):
    price, currency = input().split(' ')
    price = float(price)
    if currency == 'BTC':
        price = price*380000
    ans.append(price)
print(sum(ans))

Submission status: Accepted

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

for i in range(n):
    amount, unit = map(str, input().split())
    x[i] = float(amount)
    if unit == "BTC":
        x[i] *= 380000.0

ans = sum(x)
print(ans)

Submission status: Accepted

Solution code:
# ABC119B - Digital Gifts
def main():
    _, *XU = open(0).read().split()
    ans, RATE = 0, 380000
    for x, u in zip(*[iter(XU)] * 2):
        x = float(x)
        ans += x if u == "JPY" else x * RATE
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    otoshidama_list =  [input() for i in range(N)]

    total_price = 0
    for otoshidama in otoshidama_list:
        amount,currency =  map(str, otoshidama.split())
        amount = float(amount)
        if currency == 'BTC':
            amount = amount * 380000
        total_price += amount
    
    print(total_price)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline())

ans = 0.0
for i in range(N):
    x,u = stdin.readline().rstrip().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):
    ans += eval(input().replace(" ","*").replace("JPY","1").replace("BTC","380000"))
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
money = []
for _ in range(N):
    x , u = input().split()
    money.append([float(x) , u])

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

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
rate_btc = 380000.0
for _ in range(N):
    x, u = input().split()
    x = float(x)
    if u=="BTC":
        x *= rate_btc
    ans += 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":ans+=float(x)*380000
    else:ans+=int(x)
print(ans)

Submission status: Accepted

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