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

Submission status: Accepted

Solution code:
JPY_lst=[]
BTC_lst=[]
for i in range(int(input())):
    a,b=input().split()
    if b=='JPY':
        JPY_lst.append(float(a))
    else:
        BTC_lst.append(float(a))
print(sum(JPY_lst)+sum(BTC_lst)*380000)

Submission status: Accepted

Solution code:
# coding: utf-8

N = int(input().rstrip())
data = []
yen_1btc = 380000
total = 0

for i in range(N):
    data.append(input().rstrip().split())
    if data[i][1] == "JPY" :
        total += int(data[i][0])
    else:
        total += float(data[i][0]) * yen_1btc


print(total)

Submission status: Accepted

Solution code:
N = int(input())
answer = 0.0
for i in range(N):
    x_i, u_i = input().split()
    if u_i == "JPY":
      answer += float(x_i)
    else:
      answer += float(x_i) * 380000.0

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input().rstrip("\n"))

total_yen = 0
total_coin = 0.0
for i in range(n):
  amount, yen_or_coin = input().rstrip("\n").split(" ")
  if yen_or_coin == 'JPY':
    total_yen += int(amount)
  else:
    total_coin += float(amount)

print(total_yen + (total_coin * 380000.0))

Submission status: Accepted

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

for i in range(s):
    a,b = input().split()
    a = float(a)
    if b == "BTC":
        ans += a*380000.0
    else:
        ans += a

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

print(total)

Submission status: Accepted

Solution code:
a=int(input())

res = float(0.0)

for i in range(a):
  b=input().split()
  if b[1] == "JPY":
    res += float(b[0])
  if b[1] == "BTC":
    res += float(b[0])*380000

print(res)

Submission status: Accepted

Solution code:
N=int(input())

result = 0
for i in range(N):
    tmp = input().rstrip().split(' ')
    x = float(tmp[0])
    u = tmp[1]
    result += (x if u == "JPY" else x * 380000.0)

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

value = 0

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

print(value)

Submission status: Accepted

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

print(yen)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
print(sum([float(x)*380000 if y=="BTC" else int(x) for i in range(int(input())) for x,y in ([input().split()])]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
c = []
for i in range(n):#h:高さ
    c.append([str(m) for m in input().split()])
for i in range(n):
    c[i][0] = float(c[i][0])
ans = 0
for i in range(n):
    if c[i][1] == "JPY":
        ans += c[i][0]
    else:
        ans += c[i][0] * 3.8 * (10 ** 5)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print("{:.6f}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

ys=[]
ss=[]

for i in range(n):
    [y, s]=[i for i in input().split()]
    ys.append(y)
    ss.append(s)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#
# N = int(input())
#
# a = []
#
# for i in range(N):
#     a.append(input().split())
#
# Y = 0
#
# for figure, kind in a:
#
#     if kind == 'JPY':
#         Y += int(figure)
#     else:
#         figure = float(figure) * 380000.00000000
#         Y += figure
# print(Y)
#

import sys

N = int(input())

a = [i.strip().split() for i in sys.stdin.readlines()]

ans = 0

for b, c in a:
    if c == 'JPY':
        ans += int(b)
    else:
        ans += float(b) * 380000

print(ans)

Submission status: Accepted

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

    for line in range(0, n):
        total += calc()

    print(total)


def calc():
    x, u = map(str, input().split())

    if u == "JPY":
        return int(x)

    if u == "BTC":
        return float(x) * 380000


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random

n = int(input())
X = []
U = []
for i in range(n):
    x,u = map(str,input().split())

    X.append(float(x))
    U.append(u)

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())
j = []
b = []
for i in range(n):
  x, u = map(str, input().split())
  x = float(x)
  if u == "JPY":
    j.append(x)
  else:
    b.append(x)
print(sum(j) + 380000.0 * sum(b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

num_list = [list(input().split()) for i in range(N)]

sum = 0
for elem in num_list:
    if elem[1] == 'JPY':
        sum += float(elem[0])
    else:
        sum += float(elem[0])*380000.0

print(sum)

Submission status: Accepted

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

jpy=0.0
btc=0.0
for l in arr:
    if l[1]=="JPY":
        jpy+=float(l[0])
    else:
        btc+=float(l[0])
        
print(jpy+(btc*380000.0))

Submission status: Accepted

Solution code:
import numpy as np
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 == "BTC" :
        x *= 380000.0
    ans += x
print(ans)

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline())

jpy = 0
btc = 0
for _ in range(n):
    x, y = sys.stdin.readline().split()
    if 'JPY' in y:
        jpy += int(x)
    else:
        btc += float(x) * 380000

print(jpy + btc)

Submission status: Accepted

Solution code:
N = int(input())

x=list()
u=list()

i = 1
for i in range(N):
    value,variaty = input().split()
    if variaty == "BTC":
        abs_value = 380000.0*float(value)
    else:
        abs_value = float(value)
    x.append(abs_value)
    #print(x)
total = sum(x)
print(total)

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

N = int(input())
money = 0
for i in range(N):
    x,y = input().split()
    if y == "BTC":
        money += float(x)*380000
    else:
        money+=int(x)
print(money)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
def henkan(p):
    if(p[1] == "BTC"):
        return 380000*float(p[0])
    else:
        return float(p[0])
xu=[henkan(list(input().split())) for x in range(n)]
print(sum(xu))

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
vs = np.zeros(N)
for i in range(N):
    x,u = input().split()
    if u == "BTC":
        vs[i] = float(x)*380000.0
    elif u == "JPY":
        vs[i] = int(x)
sum_v = vs.sum()
print(sum_v)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for _ in range(N):
    x,v = input().split()
    x = float(x)
    if v == 'BTC':
        ans += 380000.0*x
    else:
        ans += x

print(ans)

Submission status: Accepted

Solution code:
#cording: utf-8

N = int(input())

x, u = [], []
for i in range(N):
    x_tmp, u_tmp = map(str, input().split())
    x_tmp = float(x_tmp)
    if u_tmp == 'BTC':
        x_tmp = x_tmp * 380000.0
    x.append(x_tmp)
    u.append(u_tmp)

print(sum(x))

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    n = int(input())
    ans = 0

    for i in range(n):
        xi, ui = input().split()

        if ui == 'JPY':
            ans += float(xi)
        else:
            ans += float(xi) * 380000

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
ans = 0.0
for _ in range(N):
  x, u = raw_input().split()
  if u=="JPY":
    ans += float(x)
  else:
    ans += float(x)*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('{:.11f}'.format(ans))

Submission status: Accepted

Solution code:
import sys

lines = sys.stdin.readlines()

if int(lines[0]) < 2 or int(lines[0]) > 10:
    exit()

totalCount = 0
for line in lines[1:]:
    line = line.strip("\n")
    splitLine = line.split(" ")
    if splitLine[1] == "JPY":
        totalCount += int(splitLine[0])
    elif splitLine[1] == "BTC":
        totalCount += float(splitLine[0]) * 380000.0

print(totalCount)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
i=0
JPY=0
while n > i:
  i=i+1
  a,b=map(str,input().split())
  a = float(a)
  if b == "JPY":
    JPY=JPY+a
  else:
    JPY=JPY+a*380000
print(JPY)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(raw_input())
table = {"JPY": 1, "BTC": 380000}
r = 0
for i in range(N):
	t = raw_input().split()
	r += table[t[1]] * float(t[0])
print r

Submission status: Accepted

Solution code:
def btc2yen(value):
    return 380000 * float(value)
total = 0
N = int(input())
for i in range(N):
    tmp = input()
    if tmp[-3:] == "BTC":
        total += btc2yen(tmp[:-4])
    else:
        total += int(tmp[:-4])
print(total)

Submission status: Accepted

Solution code:
n = int(input())

x = [0 for _ in range(n)]
u = [0 for _ in range(n)]

ans = 0

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

    if u[i] == 'JPY':
        x[i] = int(x[i])
        ans += x[i]

    else:
        x[i] = float(x[i])
        ans += 380000.0 * x[i]

print(ans)

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  N = int(input())
  ans = 0
  for _ in range(N):
    x, u = map(str, input().split())
    if u == 'JPY':
      ans += float(x)
    else:
      ans += float(x) * 380000
    
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

ans = 0
for (x,u) in XU:
    if u=="JPY":
        ans += int(x)
    else:
        ans += float(x)*380000

print(ans)

Submission status: Accepted

Solution code:
late = 380000.0
ans = 0.0
def add():
	x = input().split(' ')
	global ans
	ans += (float(x[0]) if x[1]=='JPY' else float(x[0]) * late)

n = int(input())
for i in range(n):
	add()
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = [LS() for _ in range(n)]
    r = 0
    for x,u in a:
        if u == 'JPY':
            r += int(x)
        else:
            r += float(x) * 380000.0

    return '{:0.9f}'.format(r)



print(main())

Submission status: Accepted

Solution code:
n=int(input())
listA=[]
listB=[]

for i in range(n):
    listA=input().split()
    if listA[1]=="BTC":
        listB.append(380000*float(listA[0]))
    else:
        listB.append(float(listA[0]))

print(sum(listB))

Submission status: Accepted

Solution code:
n = int(input())
jpy = 0
btc = 0
for i in range(n):
    num,cur_t = input().split()
    if cur_t =='JPY':
        jpy += int(num)
    else:
        btc += float(num)
print(jpy+btc*38*10**4)

Submission status: Accepted

Solution code:
n = int(input())
arr = [ list(input().split()) for i in range(n)]
ans = 0
for x, u in arr:
    if u == 'JPY':
        ans += int(x)
    else:
        integer, double = x.split('.')
        ans += int(integer) * 380000
        for j, num in enumerate(double, start=1):
            ans += (10 ** -j * int(num)) * 380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
x = [eval(input().replace('JPY','* 1.0').replace('BTC','* 380000.0')) for i in range(N)]
print(sum(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
sum=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())
X = [0]*N
U = [0]*N

sum_ = 0
for i in range(N):
  x_tmp,u_tmp = input().split()
  x_tmp = float(x_tmp)
  if u_tmp == 'JPY':
    sum_ += x_tmp
  else:
    sum_ += x_tmp*380000

print(sum_)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
sum = 0
for i in range(N):
	S=input().split()
	if S[1] == 'JPY':
		sum += int(S[0])
	elif S[1] =='BTC':
		sum += float(S[0])*380000.0
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

jpy=0
btc=0.0

for i in range(n):
    
    a,b=map(str,input().split())

    if b== 'JPY':
        jpy += int(a)
    else:
        btc += float(a)

print(jpy + btc* 380000.0 )

Submission status: Accepted

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

Submission status: Accepted

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

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18

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

print "{:.10f}".format(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

sum= 0

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

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
X =[]
ans = 0
for _ in range(N):
    X.append(input().split())
    X[_][0] = float(X[_][0])
    if X[_][1] == 'BTC':
        X[_][0] = X[_][0] * 380000
    ans += X[_][0]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
L=[input().split() for i in range(N)]
S=[]
for i in range(N):
    if L[i][1] == 'JPY':
        S.append(int(L[i][0]))
    else:
        S.append(float(L[i][0])*380000)

print(sum(S))

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())
xlist = []
ulist = []
for _ in range(n):
    x, u = input().split()
    xlist.append(float(x))
    ulist.append(u)

ans = 0
for x, u in zip(xlist, ulist):
    if u == 'JPY':
        ans += x
    else: # u == 'BTC'
        ans += x *  380000.0

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
btcprice=380000
jpysum=0
btcsum=0

for i in range(n):
  num,coin=input().split()
  num=float(num)
  if coin=='JPY':
    jpysum+=num
  else:
    btcsum+=num

print(jpysum+btcsum*btcprice)

Submission status: Accepted

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

for i in range(N):
    if M[i][1] == 'JPY':
        C += int(M[i][0])
    elif M[i][1] == 'BTC':
        C += float(M[i][0])*380000

print(C)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for _ in range(n):
    value, v_type = input().split()
    value = float(value)
    if v_type=="BTC":
        ans += value * 380000.0
    else:
        ans += value
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#abc119b

n=int(raw_input())
res=0.0
for i in xrange(n):
 x,u=map(str,raw_input().split())
 if u=='JPY':
  res+=int(x)
 else:
  res+=float(x)*380000
print res

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
yr_m=[]
sum_m=0
for i in range(n):
    yr_m.append(list(map(str,input().split())))

for k in range(n):
    yr_m[k][0]=float(yr_m[k][0])

for j in range(n):
    if yr_m[j][1]=="BTC":
        yr_m[j][0]=yr_m[j][0]*380000.0
    sum_m=sum_m+yr_m[j][0]

print(sum_m)

Submission status: Accepted

Solution code:
N = int(input())

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

print(summon)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(sum(0x5CC60**("B"in i)*float(i[:-4])for i in open(0).readlines()[1:]))

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()
ans = 0
for _ in range(n):
    x, u = LS()
    x = float(x)
    if u == 'BTC': x *= 380000
    ans += x
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

    sum = sum + x

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(sum(380000**('B'in s)*float(s[:-4])for s in open(0).readlines()[1:]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = 0
n = int(input())
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)