Problem:


Score : 200 points

Problem Statement

Takahashi received otoshidama (New Year's money gifts) from N of his relatives.

You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.

For example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.

If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?

Constraints

2 \leq N \leq 10

u_i = JPY or BTC.

If u_i = JPY, x_i is an integer such that 1 \leq x_i \leq 10^8.

If u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \leq x_i \leq 100.00000000.

Input

Input is given from Standard Input in the following format:

N
x_1 u_1
x_2 u_2
:
x_N u_N

Output

If the gifts are worth Y yen in total, print the value Y (not necessarily an integer).

Output will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.

Sample Input 1

2
10000 JPY
0.10000000 BTC

Sample Output 1

48000.0

The otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.

Outputs such as 48000 and 48000.1 will also be judged correct.

Sample Input 2

3
100000000 JPY
100.00000000 BTC
0.00000001 BTC

Sample Output 2

138000000.0038

In this case, outputs such as 138001000 and 1.38e8 will also be judged correct.



Sample input:
2
10000 JPY
0.10000000 BTC


Sample output:
48000.0

Submission status: Accepted

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    value,unit=map(str, input().split())
    if unit == 'BTC':
        sum += float(value) * 380000
    else:
        sum+=float(value)
print(sum)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Xs = [list(map(str, input().split())) for _ in range(N)]
one_BTC = 380000.0
otoshidama = 0
for x in Xs:
  if x[1] == "JPY":
    otoshidama += int(x[0])
  else:
    otoshidama += (float(x[0])*one_BTC)
print(otoshidama)

Submission status: Accepted

Solution code:
a = int(input())
b = [input().split() for i in range(a)]
c = 0

for i in range(a):
  if b[i][1]=="JPY":
    c+=float(b[i][0])
  else:
    c+=380000*float(b[i][0])
else:
  print(c)

Submission status: Accepted

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

n = int(input())

bit = 0
jpy = 0

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

Submission status: Accepted

Solution code:
n = int(input())
re = [list(input().split(' ')) for i in range(n)]
def b2y(btc):
  return float(btc) * 380000
ans = 0
for x, u in re:
  if u == 'JPY':
    ans += float(x)
  else:
    ans += b2y(x)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

N = int(input())
xu = [None] * N
for i in range(N):
    x, u = input().split()
    xu[i] = [float(x), u]

rate = 380000.0

ans = 0
for (x, u) in xu:
    if u == "BTC":
        ans += x * rate
    else:
        ans += x

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = 0
for i in range(n):
    if li[i][1] == "JPY":
        a += int(li[i][0])
    elif li[i][1] == "BTC":
        a +=float(li[i][0])*380000.0
print(a)

Submission status: Accepted

Solution code:
n = int(input())
l = [list(map(str,input().split())) for i in range(n)]
for i in range(n):
    l[i][0] = float(l[i][0])
#print(n,l)

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    money = 0
    for i in range(N):
        X,U = input().split()
        if U == 'JPY':
            money +=int(X)
        else:
            money += float(X)*380000
    print(money)
if __name__ =='__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    sum_money = 0
    for i in range(n):
        money = input().split()
        if money[1] == "JPY":
            sum_money += int(money[0])
        else:
            sum_money += float(money[0]) * 380000


    print(sum_money)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#a, b, k = map(int,input().split())
n = int(input())
#b = list(map(int,input().split()))
ls = [input().split() for i in range(n)]
ans = [float(i[0]) if i[1] == "JPY" else float(i[0])* 380000 for i in ls]
#s = input()
print(sum(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

x = [0] * n
u = [''] * n

for i in range(n):
  temp = input().split()
  x[i], u[i] = float(temp[0]), temp[1]
  if u[i] == 'BTC':
    x[i] *= 380000

print(sum(x))

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
n = int(input())

rate_btc = 380000.0

ans = 0.0
for _ in range(n):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
        x = x * rate_btc

    ans += x

print(ans)

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

Submission status: Accepted

Solution code:
n = int(input())

out = 0

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

print(out)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

money=0

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

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

Submission status: Accepted

Solution code:
N = int(input())


money = 0
for _ in range(N):
    xs, u = map(str, input().split()) # 横に2個
    x = float(xs)
    if u == 'BTC':
        money += x * 380000.0
    else:
        money += x

print(money)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    btc_rate = 380000
    total = 0
    N = int(sys.stdin.readline())
    for _ in range(N):
        x, u = sys.stdin.readline().split()
        if u == 'JPY':
            total += int(x)
        else:
            total += (float(x) * btc_rate)
    print(total)

Submission status: Accepted

Solution code:
n= int(input())

otsdm = 0

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

print(otsdm)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
money=[]
for _ in range(N):
    money.append([i for i in input().split()])
sum=0
for i in range(N):
    if money[i][1]=='BTC':
        sum+=float(380000*float(money[i][0]))
    else:
        sum+=float(money[i][0])

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
x_list = []
u_list = []
ans = 0

for _ in range(N):
    x, u = input().split()
    x_list.append(float(x))
    u_list.append((u))

for i in range(N):
    if u_list[i] == "JPY":
        ans += x_list[i]
    else:
        ans += x_list[i]*380000

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
rate = 380000.0
ans = 0.0
for i in range(N):
    x,u = input().split()
    x = float(x)
    ans += x * rate if u == "BTC" else x
print('{:.4f}'.format(ans))

Submission status: Accepted

Solution code:
def money(a,b):
    if b =="JPY":
        return float(a)
    else:
        return float(a)*380000

n = int(input())
sums = 0
for i in range(n):
    a,b = input().split()
    sums += money(a,b)

print(sums)

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 = list(input().split())
  x = float(x)
  if not u == "JPY":
    x *= 380000
  ans += x
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
from decimal import Decimal

n1 = int(input())

r1 = Decimal(0)
for i1 in range(n1):
    t1 = [i for i in input().split()]
    if t1[1] == "JPY":
        r1 += Decimal(t1[0])
    else:
        r1 += Decimal(t1[0]) * Decimal(380000.0)

print(r1)

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])
    
for i in range(N):
    if u[i] == "BTC":
        x[i] = x[i] * 380000.0
        
print(sum(x))

Submission status: Accepted

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

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

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans=0.0
for i in range(n):
    x, u = 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())
xu = [list(map(str,input().split())) for i in range(n)]
ans = 0
for i in range(n):
    if xu[i][1]=='JPY':
        ans += float(xu[i][0])
    else:
        ans += float(xu[i][0])*380000
print(round(ans,6))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

sum = 0.0    
for tmp in a :
    if tmp[1] == "BTC" :
        sum += 380000.0*float(tmp[0])
    else :
        sum += float(tmp[0])
        
print(sum)

Submission status: Accepted

Solution code:
N = int(input())
o = []
mon = 0
for i in range(N):
  x = input().split(' ')
#  print(x[0],x[1])
  if x[1] == 'BTC':
    mon +=float(x[0])*380000
  else:
    mon +=int(x[0])
 

print(mon)

Submission status: Accepted

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

ans=0
for i in range(N):
    ans+=float(listA[i][0])*(1,380000)[listA[i][1]=='BTC']
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def abc():
    n = int(input().rstrip())
    chip = 0.0
    for i in range(n):
        x, u = input().rstrip().split()
        c = float(x)
        if u == 'BTC':
            c = c * 380000.0
        chip += c
    print(chip)


abc()

Submission status: Accepted

Solution code:
N=int(input())

sum = 0
for i in range(N):
  val,cur = input().split()
  if cur == "JPY":
    sum += int(val)
  else:
    sum += float(val)*380000.0

print(sum)

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

money = 0
for _ in range(n):
  num, credit = input().split()
  if credit == 'JPY':
    money += int(num)
  else:
    money += float(num) * 380000.0
    
print(money)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
xu=[list(map(str,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 = []

total = 0
for i in range(n):
    x_tmp, u_tmp = input().split()
    if u_tmp == 'JPY':
        total += int(x_tmp)
    elif u_tmp == 'BTC':
        total += float(x_tmp) * 380000

print(total)

Submission status: Accepted

Solution code:

n = int(input())
ans = 0
btc = 380000

for _ in range(n):
    x,u = list(input().split())
    if u=="JPY":
        ans += float(x)
    else:
        ans += float(x) * btc

print(ans)

Submission status: Accepted

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

goukei=0

for ii in range(N):
    if otoshidama[ii][1] == "JPY":
        goukei += float(otoshidama[ii][0]) * 1.0
    elif otoshidama[ii][1] == "BTC":
        goukei += float(otoshidama[ii][0]) * 380000.0

print(goukei)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N = int(input())
x, u = [''] * N, [''] * N
ans = 0.0

for i in range(N):
	x[i], u[i] = input().split()
	x[i] = float(x[i])
	if u[i] == 'JPY':
		ans += x[i]
	else:
		ans += x[i] * 380000.0
	
print(ans)

Submission status: Accepted

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

# float型に変換
for i in range(0, len(lst)):
    lst[i][0] = float(lst[i][0])

ans_sum = 0
for i in range(0, len(lst)):
    if lst[i][1] == 'JPY':
        ans_sum += lst[i][0]
    else:
        ans_sum += lst[i][0]*380000

print(ans_sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = [0] * n
u = [0] * n
for i in range(n):
  x[i], u[i] =input().split()
u=[s.replace("JPY","1") for s in u]
u=[s.replace("BTC","380000") for s in u]
s=0
for i in range(n):
  s=s+float(x[i])*int(u[i])
print(s)

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N = int(sys.stdin.readline())
X, U = list(zip(*[map(str, sys.stdin.readline().split()) for _ in range(N)]))

ans = 0
for x, u  in zip(X, U):
    x = float(x)
    if u == 'BTC':
        x *= 380000
    ans += x
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
jpy,btc=0,0
for _ in range(n):
    xi,ui=input().split()
    if ui=="JPY":
        jpy+=int(xi)
    else:
        btc+=float(xi)
print("{:.6f}".format(jpy+380000*btc))

Submission status: Accepted

Solution code:
from decimal import *

d = Decimal(0)
y = 0

N = int(input())
for _ in range(N):
    xi, ui = input().split()
    if ui == "JPY":
        y += int(xi)
    else:
        d += Decimal(xi)

print(d * Decimal('380000.0') + Decimal(y))

Submission status: Accepted

Solution code:
n=int(input())
x=[]
y=[]
a=0
for _ in range(n):
    x1,y1=input().split()
    x.append(x1)
    y.append(y1)
for i in range(n):
    if y[i]=="JPY":
        a+=int(x[i])
    elif y[i]=="BTC":
        a+=float(x[i])*380000.0
print(a)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x=[]
u=[]
for _ in range(n):
    xx,uu = map(str,input().split())
    x.append(float(xx))
    u.append(uu)
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())
sums=0
for i in range(n):
    a,b=input().split()
    if b=="JPY":
        sums+=float(a)
    else:
        sums+=float(a)*380000
print(sums)

Submission status: Accepted

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

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

sum_otoshidama = 0.0
for i in range(N):
    x = float(xu[i][0])
    u = xu[i][1]

    if u == 'JPY':
        sum_otoshidama += x
    else:
        sum_otoshidama += x * 380000.0

print(sum_otoshidama)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

Y = 0
B = 0

for _ in range(N):
    x, u = input().split()
    x  = float(x)
    if u == 'JPY':
        Y += x
    elif u == 'BTC':
        B += x

ans = Y + 380000 * B

print(ans)

Submission status: Accepted

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

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

print(money)

Submission status: Accepted

Solution code:
n = int(input())
moneys = []
for i in range(n):
    tmp = input().split()
    x = float(tmp[0])
    y = tmp[1]
    moneys.append([x,y])


sum = 0
for i in moneys:
    if i[1] == "JPY":
        sum = sum + i[0]
    else:
        sum = sum + i[0] * 380000.0

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
x = 0
for i in range(N):
    x_1, y_1 = input().split()
    x_1 = float(x_1)
    if y_1 == 'BTC':
        x_1 = x_1 * 380000.0
    x += x_1


print(x)

Submission status: Accepted

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

Submission status: Accepted

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

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

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)

Submission status: Accepted

Solution code:
N = int(input())

money = 0

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

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

Y = 0

for i in range(N):
    if U[i] == "JPY":
        Y += X[i]
    else:
        Y += X[i] * 380000.0
        
print(Y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
li = [input().split() for _ in range(N)]
ans = 0
for i in range(N):
  if li[i][1] == 'JPY':
    ans += int(li[i][0])
  else:
    ans += float(li[i][0]) * 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+=int(x)
    else:
        ans+=float(x)*380000
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
money=[]
for i in range(n):
  x,u=input().split()
  if u=='JPY':
    money.append(int(x))
  elif u=='BTC':
    money.append(float(x)*380000.0)
print(sum(money))

Submission status: Accepted

Solution code:
N = int(input())
res = 0
while N > 0:
  x,u = input().split()
  res += float(x) if u == 'JPY' else float(x)*380000
  
  N -= 1
print(res)

Submission status: Accepted

Solution code:
n = int(input())

yen = 0

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

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('{:.6f}'.format(ans))

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

Submission status: Accepted

Solution code:
n = int(input())

total = 0

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

print(total)

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 i in range(N):
  x, u = input().strip().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):
    s,t = map(str,input().split())
    if t == "JPY":
        ans += int(s)
    else:
        ans += float(s) * 380000
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(n):
  money, kind = [ v for v in input().split() ]
  money = float(money)
  if kind == "BTC":
    money = money*380000.0
  ans += money
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
l=[]
for i in range(N):
  d,t=input().split()
  l.append([d,t])
m=0
for i in l:
  if i[1] == "JPY":
    m=m+int(i[0])
  else:
    m=m+380000.0*float(i[0])
print(m)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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