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())
Y=[]
for i in range(N):
  list=input().split()
  money=float(list[0])
  if list[1]=="JPY":
    Y.append(money)
  else:
    Y.append(380000.0*money)
all=0
for j in Y:
  all+=j
print(all)

Submission status: Accepted

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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
data = []
for i in range(n):
    a, b = map(str, input().split())
    data.append([float(a), b])

jpy_sum = 0
btc_sum = 0
for j in range(n):
    if data[j][1] == 'JPY':
        jpy_sum += data[j][0]
    else:
        btc_sum += data[j][0]

print(jpy_sum + 380000.0 * btc_sum)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

  if u == "BTC":
      x *= 380000.0

  s += x
 
    
print(s)

Submission status: Accepted

Solution code:
N=int(input())
l=[]
L=[]
for i in range(N):
  a,b=(input().split())
  l.append((a,b))
for i in range(N):
    c,d=l[i]
    if d=="JPY":
        L.append(float(c))
    else:
        L.append(float(c)*380000.0)
print(sum(L))

Submission status: Accepted

Solution code:
N = int(input().strip())
XU = []
for i in range(N):
	XU.append(list(map(str, input().strip().split(' '))))	#[A][B]

kane = 0

for i in range(N):
    if(XU[i][1] == "BTC"):
        kane = kane + float(XU[i][0])*380000
    else:
        kane = kane + float(XU[i][0])

print(kane)

Submission status: Accepted

Solution code:
N = int(input())
Money = []
Tot   = 0


for n in range(N):
	 Money.append(input().split())

for n in range(N):
	if Money[n][1] == "JPY":
		Tot += float(Money[n][0])
	else:
		Tot += float(Money[n][0])*380000

print(Tot)

Submission status: Accepted

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

ans = sum([int(x[i]) for i in range(N) if u[i] == 'JPY'])
ans += sum([float(x[i])*380000.0 for i in range(N) if u[i] == 'BTC'])
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
X = np.array([0. for i in range(N)])
U = np.array([0. for i in range(N)])

for i in range(N):
	x, u = input().split()
	x = float(x)
	X[i] = x
	if u == 'JPY':
		U[i] = 1.0
	elif u == 'BTC':
		U[i] = 380000.0

A = np.dot(X,U)

print(A)

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)
    elif u == 'BTC':
        sum += float(x) * 380000.0
print(sum)

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

Submission status: Accepted

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

for m in money:
    if m[1] == "BTC":
        total += float(m[0])*380000
    else:
        total += int(m[0])

print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0.0
BTC = 380000.0

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
otosidamas = [[]*2]*n
BTCtoJPY = 380000.0
sum = 0

for i in range(len(otosidamas)):
    otosidamas[i] = input().split()
    otosidamas[i][0] = float(otosidamas[i][0])
    if otosidamas[i][1] == "BTC":
        sum += BTCtoJPY * otosidamas[i][0]
    else:
        sum += otosidamas[i][0]


print(sum)

Submission status: Accepted

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

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

print(sumyen)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
sum = 0
e = [[i for i in input().split()] for i in range(N)] 

for i in e:
    if i[1] == "JPY":
        sum += int(i[0])
    else:
        sum += float(i[0])*380000
print(sum)

Submission status: Accepted

Solution code:
total = 0
times = int(input())
for i in range(times):
    value = input().rstrip().split(" ")
    if(value[1]=="JPY"):
        total += int(value[0])
    else:
        total += (float(value[0])*380000)
print(total)

Submission status: Accepted

Solution code:
N = int(input())

bit1 = 380000.0

ans = 0

for i in range(N):
    S = input().split()
    if S[1] == 'JPY':
        ans += float(S[0])
    elif S[1] == 'BTC':
        ans += (float(S[0]) * bit1)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
x = [list(input().split()) for i in range(n)]
j = [float(v[0]) for v in x if v[1] == 'JPY']
b = [float(v[0]) * 380000 for v in x if v[1] == 'BTC']
print(sum(j)+sum(b))

Submission status: Accepted

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

total = 0
for x in l:
    if x[1] == "JPY":
        total += float(x[0])
    if x[1] == "BTC":
        total += float(x[0]) * 380000.0
print(total)

Submission status: Accepted

Solution code:
N=int(input())
ans=0.0
for i in range(N):
  (x,u)=map(str,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 = 0.00000

for i in range(n):
	V, T= input().split()
	V = float(V)
	if T == "JPY":
		sum = sum + V
	else:
		sum = sum + V*380000.0

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
from collections import defaultdict

#key = {1:2, 2:5, 3:5, 4:4, 5:5, 6:6, 7:3, 8:7, 9:6}

# N, M = map(int, input().split())  #
# A = [int(k) for k in input().split()] 

N = int(input())  #
x_list = list()
u_list = list()
for i in range(N):
    x, u = input().split(' ')  # type(A) => <class 'str'>
    x = float(x)
    #print(x,u)
    #x, u = map(int, input().split())  #
    x_list.append(x)
    u_list.append(u)

suma = 0
for x, u in zip(x_list, u_list):
    if u == "JPY":
        suma += x
        pass
    elif u == "BTC":
        suma += x*380000
print(suma)

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

Submission status: Accepted

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

btc = 380000
a = 0
for e in hoge:
    if e[1] == 'JPY':
        a += float(e[0])
    else:
        a += float(e[0]) * btc
print(a)

Submission status: Accepted

Solution code:
N = int(input())
x_list = [0] * N
u_list = [0] * N
rate = 380000.0

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

print(total)\

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

s = 0
for i in range(n):
    v,k = input().split()
    if(k == 'BTC'):
        s = s + float(v)*380000.0
    elif(k == 'JPY'):
        s = s + int(v)
        
print(s)

Submission status: Accepted

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

ans = 0

for j in range(n):
    if arr[j][1] == 'JPY':
        ans += int(arr[j][0])
    else:
        ans += float(arr[j][0]) * 380000.0
        
print(ans)

Submission status: Accepted

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

sum = 0
for m in range(len(otl)):
  if otl[m][1] == 'JPY':
    sum += float(otl[m][0])
  elif otl[m][1] == 'BTC':
    sum += float(otl[m][0])*380000.0
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
money = []
sum = 0

for i in range(n):
    x, u = list(map(str, input().split()))
    x = float(x)
    money.append([x,u])

for i in range(n):
    if money[i][1] == 'JPY':
        sum += money[i][0]
    else:
        sum += money[i][0] * 380000

print(sum)

Submission status: Accepted

Solution code:
num = int(input())

inputs = []
total = 0.0

for i in range(num):
  line = input().split(' ')
  
  if line[1] == 'JPY':
    total += int(line[0])
  elif line[1] == 'BTC':
    total += float(line[0]) * 380000.0

print(total)

Submission status: Accepted

Solution code:
rate = 380000.0 # BTC/yen
sum = 0

N = int(input())

for n in range(N):
    x, u = input().split()
    if u == 'JPY':
        sum += float(x)
    else:
        sum += float(x) * rate

print(sum)

Submission status: Accepted

Solution code:
#coding: utf-8
sum_ = 0
N = int(input())
for i in range(N):
    num, type_ = input().split()
    if type_ == "JPY":
        sum_ += float(num)
    else:
        sum_ += float(num) * 380000
print(sum_)

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0.0
for i in range(N):
    x, u = map(str, input().split())
    if u == 'JPY':
        sum += float(x)
    elif u == 'BTC':
        sum += float(x) * 380000.0

print(sum)

Submission status: Accepted

Solution code:
N = int(input())

money = 0.0
def calc(list1, money):
    if list1[1] == 'JPY':
        return money + float(list1[0])
    else:
        return money + float(list1[0]) * 380000.0

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

print(money)

Submission status: Accepted

Solution code:
n = int(input())
S = 0
for i in range(n):
    a = input().split()
    if a[1] == "BTC":
        S += float(a[0]) * 380000.0
    else :
        S+= float(a[0])
print(S)

Submission status: Accepted

Solution code:
n = int(input()) #整数
ans = 0.0
rate = 380000.0
for i in range(n):
    a, b = [s for s in input().split() ]
    if b == "JPY":
        ans += int(a)
    else:
        ans += float(a)*rate
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

s = 0

for d in data:
  s1 = float(d[0])
  if d[1] == "BTC":
    s += s1 * 380000.0
  else:
    s += s1
print(s)

Submission status: Accepted

Solution code:
N = int(input())
xv = []
for i in range(N):
  x,v = input().split()
  if v == "BTC":
    x=float(x)
  else:
    x=int(x)
  xv.append([x,v])
dama=0
for i in range(N):
    if xv[i][1] == "JPY":
        dama+=xv[i][0]
    else:
        dama+=xv[i][0]*380000.0
print(dama)

Submission status: Accepted

Solution code:
N = int(input())
JPY_BTC = 380000.0
total = 0
for _ in range(N):
    tmp = input().split()
    yen = float(tmp[0])
    if tmp[1] == 'BTC':
        yen = yen * JPY_BTC
    total += yen
print(total)

Submission status: Accepted

Solution code:
n = input()

ans = 0
for _ in range(int(n)):
    x, u = input().split()

    if u == 'BTC':
        ans += float(x)*380000
    else:
        ans += float(x)

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 2019/2/24
Solved on 2019/2/24
@author: shinjisu
"""


# ABC 119
def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


ALPHABET = [chr(i+ord('a')) for i in range(26)]
DIGIT = [chr(i+ord('0')) for i in range(10)]
N1097 = 10**9 + 7


def dmp(x, cmt=''):
    global debug
    if debug:
        if cmt != '':
            print(cmt, ':  ', end='')
        print(x)
    return x


def probB():
    N = getInt()
    dmp(N)
    sm = 0.0
    for i in range(N):
        x, u = [a for a in input().split()]
        dmp((x,u))
        if u == 'JPY':
            x = int(x)
        else:
            x = float(x) * 380000.0
        sm += x
    return sm


debug = False  # True False
print(probB())


def gcd(x, y):  # 最大公約数
    m = max(x, y)
    n = min(x, y)
    while m % n != 0:
        w = m % n
        m = n
        n = w
    return n


def probC():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    hp = A[N-1]
    for i in range(N-1):
        hp = gcd(hp, A[i])
        dmp(hp)
    return hp


def probD():
    N, M = getIntList()
    A = getIntList()
    dmp((N, M))
    dmp(A)
    return num


def probA():
    S = input()
    dmp(S)
    y = int(S[0:4])
    m = int(S[5:7])
    d = int(S[8:10])
    dmp((y,m,d))
    HEI = 'Heisei'
    if y <= 2018:
        return HEI
    if m <= 4:
        return HEI
    else:
        return 'TBD'

Submission status: Accepted

Solution code:
n = int(input())

sum = 0.0
for i in range(n):
    s = input().split(" ")
    x = float(s[0])
    u = s[1]
    if u == "JPY":
        sum += x
    else:
        sum += 380000 * x

print(sum)

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

yen = 0.
for i in range(N):
	x, u = input().split(' ')
	if u == 'JPY':
		yen += float(x)
	elif u == 'BTC':
		yen += 380000.0*float(x)

print(yen)

Submission status: Accepted

Solution code:
#import collections
N = int(input())
r = 0
m = {"JPY":1,"BTC":380000}
for _ in range(N):
    i,j = input().split()
    i = float(i)
    r += i*m[j]
print(r)

Submission status: Accepted

Solution code:
N = int(input())

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

print(otoshidama)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())  #数値入力
X = [0] * N
U = [0] * N

for i in range(N):
    X[i], U[i] = input().split()
    X[i] = float(X[i])

ans=0
for i in range(N):
    if U[i] =="JPY":
        ans += X[i]
    else:
        ans += X[i] * 380000

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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:
def main():
    N = int(input())
    money = 0
    for i in range(N):
        x, u = map(str, input().split())
        x = float(x)
        if u == 'JPY':
            money += x
        elif u == 'BTC':
            money += x * 380000

    print(money)


if __name__ == '__main__':
    main()

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

print(total)

Submission status: Accepted

Solution code:
N=int(input())
ans=0
for i in range(N):
  m,t=input().split()
  if t=='JPY':
    ans+=int(m)
  else:
    indi,low=m.split('.')
    ans+=int(indi)*380000.0+int(low)*(10**(-8))*380000.0
    
print(ans)

Submission status: Accepted

Solution code:
num = int(input())
sum = 0
for _ in range(num):
  data = input()
  data_lst = data.split()
  if data_lst[1]=="JPY":
    sum+=int(data_lst[0])
  else:
    sum+=float(data_lst[0])*380000.0

print(sum)

Submission status: Accepted

Solution code:
n = int(input())
jp_list = []
btc_list = []
for i in range(n):
    s = list(input().split())
    if s[1] == 'JPY':
        jp_list.append(float(s[0]))
    else:
        btc_list.append(float(s[0]))
print(sum(jp_list)+sum(btc_list)*380000)

Submission status: Accepted

Solution code:
# coding: utf-8

import sys

def _main():
    N = int(input())

    total = 0

    for n in range(N):
        text = input()
        data = text.split(' ')
        
        if data[1] == 'JPY':
            total += int(data[0])
        elif data[1] == 'BTC':
            total += float(data[0]) * 380000

    print(total)

if __name__ == '__main__':
    _main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

x =[]
y =[]
for i in range(n):
    x1, y1 = [i for i in input().split()]
    x.append(x1)
    y.append(y1)


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

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
iTotal  = 0.0
for _ in range(N):
    x,u=input().split()
    x = float(x)
    if u == "BTC":
        x = x * 380000.0
    iTotal += x
print(iTotal)

Submission status: Accepted

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

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

	if x[1] == 'JPY':
		y += float(x[0])
	else:
		y += float(x[0])*380000.0

print(y)

Submission status: Accepted

Solution code:
N = int(input())

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

print(total)

Submission status: Accepted

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

import sys

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

    total = 0
    for _ in range(n):
        l = sys.stdin.readline().split(" ")
        x, u = float(l[0]), l[1].strip()
        if u == "JPY":
            total += x
        else:
            total += x * 380000.0

    print(total)

main()

Submission status: Accepted

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

def f(x, u):
    if u == "JPY":
        return int(x)
    else:
        return float(x) * 380000.0

print(sum(f(x, u) for x, u in xu))

Submission status: Accepted

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

Submission status: Accepted

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

yen = []
for x, u in xu:
    if u == "JPY":
        yen.append(x)
    else:
        yen.append(x*380000.0)

print(sum(yen))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
N = int(input()) 

count = 0

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

    if u == "JPY":
        count += x
    else:
        count += 380000.0 * x
 
print(count)

Submission status: Accepted

Solution code:
n = int(input())
a = []
b = []
for i in range(n):
    x,u = map(str,input().split())
    if u == "JPY":
        a.append(int(x))
    elif u == "BTC":
        b.append(float(x))
print(sum(a)+sum(b)*380000.0)

Submission status: Accepted

Solution code:
n = int(input())
xu = [input().split() for _ 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())
otoshidama = []
for i in range(N):
    x, u = input().split(" ")
    otoshidama.append([float(x),u])

ypb = 380000.0
sum = 0.0

for x,u in otoshidama:
    if u == "JPY":
        sum += x
    else:
        sum += ypb * x

print(sum)

Submission status: Accepted

Solution code:
def btc2jpy(x):
    return 380000 * x


N = int(input())
jpy = 0
btc = 0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        jpy += x
    else:
        btc += x

result = jpy + btc2jpy(btc)
print(result)

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

Submission status: Accepted

Solution code:
n = int(input()) 

def f(a, b):
  if b == 'JPY':
    return a
  else :
    return 380000.0 * a
s = 0
for i in range(n):
  a,b =  input().split(' ')
  s += f(float(a),b)
print(s)

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
def main():
    y = 0
    N = int(input())
    for _ in range(N):
        t = input()
        x = float(t.strip().split(' ')[0])
        u = t.strip().split(' ')[1]
        if u == 'BTC':
            y += 380000.0 * x
        else:
            y += x

    print(y)
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for _ in range(n):
    #x=int(input())
    #u=input()


    x,u=[i for i in input().split()]
    x=float(x)
    if u=="JPY":
        money += x
    else:
        money += x*380000
print(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
string_list=[input() for i in range(n)]

sum_otoshidama = 0
for i in range(n):
  if string_list[i].split(' ')[1] == 'JPY':
    sum_otoshidama += float(string_list[i].split(' ')[0])
  else:
    sum_otoshidama += float(string_list[i].split(' ')[0]) * 380000

print(sum_otoshidama)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# いっこ入力
n =int(input())
# n行の複数列ある数値を二次元配列へ。x[n][?]
x = [[i for i in input().split()] for i in range(n)]

answer =0

for i in range(n):
    if x[i][1] == 'BTC':
        answer +=   float(x[i][0]) * 380000.0
    else:
        answer += int(x[i][0])

print(answer)

Submission status: Accepted

Solution code:
N = int(input())

a = []

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

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

print(money)

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
    l = input()
    ui = l[-3:]
    xi = float(l[:-3])
    if ui == 'JPY':
        s += xi
    elif ui == 'BTC':
        s += xi*380000.0
    else:
        pass
print(s)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
value=0
for i in range(N):
  line=list(input().split())
  x=float(line[0])
  u=str(line[1])
  if u=='JPY':
    value+=x
  elif u=='BTC':
    value+=x*380000.0
print(value)

Submission status: Accepted

Solution code:
N =  int(input())
given = [list(input().split()) for i in range(N)]
rate = 380000

def solve():
    given_yen = 0
    given_btc = 0
    for comb in given:
        if comb[1] == 'JPY':
            given_yen += int(comb[0])
        if comb[1] == 'BTC':
            given_btc += float(comb[0])
    return given_yen + given_btc * rate

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

t = 0

for i in range(0,N):
    if u[i] == 'JPY':
        t = t + int(x[i])
    else:
        t = t + (380000*float(x[i]))

print(t)

Submission status: Accepted

Solution code:
N = int(input())
x, u = [[], []]
for i in range(N):
    temp = input().split()
    u.append(temp[1])
    if temp[1] == "JPY":
        x.append(int(temp[0]))
    else:
        x.append(float(temp[0]))

btc = 380000.0
jpy = 1.0

result = 0
for i in range(N):
    if u[i] == "JPY":
        result += x[i] * jpy
    else:
        result += x[i] * btc
print(result)