Problem:


Score : 200 points

Problem Statement

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

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

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

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

Constraints

2 \leq N \leq 10

u_i = JPY or BTC.

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

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

Input

Input is given from Standard Input in the following format:

N
x_1 u_1
x_2 u_2
:
x_N u_N

Output

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

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

Sample Input 1

2
10000 JPY
0.10000000 BTC

Sample Output 1

48000.0

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

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

Sample Input 2

3
100000000 JPY
100.00000000 BTC
0.00000001 BTC

Sample Output 2

138000000.0038

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



Sample input:
2
10000 JPY
0.10000000 BTC


Sample output:
48000.0

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

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

        if u == 'BTC':
            x = float(x) * 380000
        money.append(float(x))

    moneysum = float(sum(money))
    print(moneysum)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def btc_to_jpy(btc):
    return btc * 380000


N = int(input())
sum = 0
for i in range(N):
    q, c = input().split()
    if c == 'JPY':
        q = int(q)
        sum += q
    else:
        q = float(q)
        sum += btc_to_jpy(q)
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

  if b == "JPY":
    total += int(a)
  else:
    total += float(a)*380000
print(total)

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

Submission status: Accepted

Solution code:
btc = 380000.0

n = int(input())

ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        ans += x
    elif u == "BTC":
        ans += x * btc

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
N=int(input())
s=0
for i in range(N):
  u = input().split()
  if u[1] == "JPY":
    s+=float(u[0])
  else:
    s+=float(u[0])*380000.0
print(s)

Submission status: Accepted

Solution code:
a = int(input())
A=[]
for i in range(a):
  array = input().split(' ')
  A.append(array)

sum=0
for j in A:
  if j[1]=='JPY':
    sum += int(j[0])
  else:
    sum += float(j[0])*380000
print(sum)

Submission status: Accepted

Solution code:
N = int(input())
total_yen = 0
btc = 0
for i in range (N):
    x, u =map(str,input().split())
    if u == 'JPY':
        total_yen += float(x)
    else:
        btc       += float(x)

print(total_yen+380000.0*btc)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input())

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

print(sum)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N=int(input())
sum=0
XU=[]

for i in range(N):
    XU=input().split()
    if XU[1]=='JPY':
        sum+=float(XU[0])
    else:
        sum+=float(XU[0])*380000.0
        
print(sum)

Submission status: Accepted

Solution code:
from decimal import Decimal
N = int(input())

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

result = 0

for t in target:
    if t[1] == 'JPY':
        result += int(t[0])
    else:
        #print(Decimal(t[0]) * Decimal(38000.0))
        result += Decimal(t[0]) * Decimal(380000.0)
print(result)

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

print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(x))

Submission status: Accepted

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

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

jpy = 0
bit = 0
rate = 380000
for i in range(N):
    m,c = input().split()
    if c == 'JPY':
        jpy = jpy + int(m)
    else:
        bit = bit + float(m)

print(jpy + bit * rate)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

rate = 380000.0

total = 0.0
for xu in xulist:
    x = float(xu[0])
    u = xu[1]
    if u == 'BTC':
        x *= rate
    total += x

print(total)

Submission status: Accepted

Solution code:
# coding: utf-8

def main():
    N = int(input())
    btc_to_jpy = 380000.0
    ans = 0
    for i in range(N):
        temp_value,unit = input().split()
        value = float(temp_value)
        if unit == "BTC":
            value *= btc_to_jpy
        ans += value
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
_ = input()
price = 0
for line in sys.stdin:
  x,u = line.strip().split(' ')
  if u == 'JPY':
    price += float(x)
  else:
    price += float(x)*380000.0
print(price)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, x: "List[float]", u: "List[str]"):
    ret = 0
    for xx, uu in zip(x, u):
        ret += xx * {
            'JPY': 1.0,
            'BTC': 380000.0
        }[uu]
    return ret

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]" 
    u = [str()] * (N)  # type: "List[str]" 
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    result = solve(N, x, u)
    print(result)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
d = {'JPY': 1.0, 'BTC': 380000.0}
num = 0
for i in range(N):
    x, u = input().split()
    num += float(x) * d[u]

print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

a = 0
for _ in range(N):
  m = input().split()
  u = int(m[1].replace('JPY','1').replace('BTC','380000'))
  x = float(m[0])
  a += x * u
  
print(a)

Submission status: Accepted

Solution code:
from __future__ import print_function
import numpy as np
import sys
import math,string,itertools,fractions,heapq,collections,re,array,bisect,copy,functools
# from itertools import accumulate
# from collections import deque
import random


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

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

#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#

Submission status: Accepted

Solution code:
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = input().split()
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(str, input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)

ans = np.dot(x_arr, u_arr)
print(ans[0])

Submission status: Accepted

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

Submission status: Accepted

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

print(summ)

Submission status: Accepted

Solution code:
N = int (input())
T = 0
for i in range(N):
    X,Y = input().split()
    X = float(X) 
    if Y == 'JPY':
        z = X
    else:
        z = X * 380000
    T += z

print(T)

Submission status: Accepted

Solution code:
N = int(input())
x_list = []
u_list = []
sum = 0
for i in range(N):
    x, u = map(str, input().split())
    if u == "JPY":
        sum += float(x)
    else:
        sum += float(x) * 380000.0
print(float(sum))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


def bit2yen(x):
    return x * 380000

ans = 0

for i in range(N):
    x, y = input().split()
    if y == "JPY":
        ans += int(x)
    else:
        ans += bit2yen(float(x))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

XYvalue = map(lambda xy:[float(xy[0]), float(xy[0]) * 380000.0][not("JPY" == xy[1])], XY)

print(sum(XYvalue))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(s)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(N):
  num, t = map(str, input().split())
  num = float(num)
  if t == 'JPY':
    ans += num
  else:
    ans += num * 380000
print(ans)

Submission status: Accepted

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

print(p)

Submission status: Accepted

Solution code:
# ABC119B - Digital Gifts
# Better ver.
RATE = 380000
n = int(input())
total = 0

for _ in range(n):
    x, u = input().rstrip().split()
    x = float(x)
    total += x if u == "JPY" else x * RATE

print(total)

Submission status: Accepted

Solution code:
# ABC119B - Digital Gifts
n = int(input())
lst = [input().rstrip().split() for _ in range(n)]
total = 0

for i in range(n):
    if lst[i][1] == 'JPY':
        total += int(lst[i][0])
    else:
        total += 380000 * float(lst[i][0])
        
print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

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

    print(total)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

rate = 380000.0

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

Submission status: Accepted

Solution code:
N = int(input())
x = [0] * N
u = [0] * N
ans = 0

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

    if u[i] == 'BTC':
        ans += x[i] * 380000
    else:
        ans += x[i]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
xu = [input().split() for _ in range(N)]
total = 0.0
for x, u in xu:
    x = float(x)
    if u == "BTC":
        x *= 380000
    total += x
print(total)

Submission status: Accepted

Solution code:
by = {"JPY" : 1.0, "BTC" : 380000.0}

N = int(input())
lst = [input().split() for i in range(N)]
lst = [[float(lst[i][0]), lst[i][1] ] for i in range(N)]
s = sum([lst[i][0] * by[lst[i][1]] for i in range(N)])
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
x=[0]*N
u=[0]*N
ans = 0
rate = 380000.0
for i in range(N):
    x[i],u[i] = input().split()
    if u[i]=='JPY':
        x[i]= int(x[i])
        ans += x[i]
    elif u[i]=='BTC':
        x[i] = float(x[i])
        ans += x[i]*rate
    else:
        raise AssertionError
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum_money)

Submission status: Accepted

Solution code:
N = int(input())
yen = 0.0
goukei = 0.0
tuuka = ""
b2y = lambda y: y*380000
for i in range(N):
  yen, tuuka = input().split()
  if tuuka == "JPY":
    yen = int(yen)
    goukei += yen
  elif tuuka == "BTC":
    yen = float(yen)
    yen = b2y(yen)
    goukei += yen
print(goukei)

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:
N = int(input())
money = [input().rstrip().split() for _ in range(N)]
total = 0
JPY = [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY']
BTC = [float(money[i][0])*380000.0 for i in range(N) if money[i][1] == 'BTC']

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

Submission status: Accepted

Solution code:
# B - Digital Gifts
# https://atcoder.jp/contests/abc119/tasks/abc119_b
ER = 380000.0

N = int(input())

total_yens = 0.0

for i in range(N):
    u_i, x_i = raw_input().split()
    if x_i == 'JPY':
        total_yens += int(u_i)
    else: # x_i == 'BTC'
        total_yens += (float(u_i) * ER)

print '{0:.4f}'.format(total_yens)

Submission status: Accepted

Solution code:
N = int(input())

xun = []
for _ in range(N):
	x,u = input().split()
	xun.append([x,u])
	
sumYen = 0
for xu in xun:
	if xu[1] == "BTC":
		sumYen += (float(xu[0])*380000)
	else:
		sumYen += int(xu[0])
		
print(sumYen)

Submission status: Accepted

Solution code:
N = int(input())
S = [list(map(str, input().split())) for i in range(N)]
Y = 0
for i in range(N):
    if(S[i][1] == 'BTC'):
        Y += float(S[i][0]) * 380000
    else:
        Y += float(S[i][0])
print(Y)

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
X = []
U = []
total = 0
for i in range(N):
    a,b = map(str, input().split())
    X.append(a)
    U.append(b)

for i in range(len(X)):
    if U[i] == "JPY":
        total += int(X[i])
    else:
        n = float(X[i]) * 380000
        total += n
print(total)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

print(sum)

Submission status: Accepted

Solution code:
n = int(input())

s = 0

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
dic = { "JPY": 0, "BTC": 0 }
for i in range(0, num):
    val, coin = input().split(' ')
    dic[coin] += float(val)
print(dic["JPY"] + (dic["BTC"] * 380000.0))

Submission status: Accepted

Solution code:
N = int(input())
sum = 0.0

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

print(sum)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(sum_money)

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

Submission status: Accepted

Solution code:
import sys

n = int(input())
money = 0
for i in range(n):
	y = sys.stdin.readline().rstrip('\n')
	a,b = y.split(' ')
	x = float(a)
	if b == 'JPY':
		money = money + x
	else:
		money = money + x * 380000.0

print(money)

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
res=0.0
for _ in range(N):
  mon,sib=input().split()
  if sib=='JPY':
    res+=float(mon)
  elif sib=='BTC':
    res+=float(mon)*380000.0
print(res)

Submission status: Accepted

Solution code:
N = int(input())

gifts = []
for _ in range(N):
    x, u = map(str, input().split())
    gifts.append([float(x), u])
    
ans = 0.0
for g in gifts:
    x = g[0]
    u = g[1]
    
    if u == 'JPY':
        ans += x
    
    if u == 'BTC':
        ans += x * 380000.0

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(0, n):
    money = input().split()
    if(money[1] == "JPY"):
        m += int(money[0])
    else:
        m += float(money[0]) * 380000

print(m)

Submission status: Accepted

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

for value, unit in A:
    if unit == "BTC":
        ans += float(value)*380000
    else:
        ans += float(value)

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
x=[]
u=[]
for i in range(n):
    xu = list(map(str,input().split()))
    x.append(float(xu[0]))
    mon = xu[1]
    if mon == "JPY":
        u.append(1)
    else:
        u.append(380000)
s = 0
for i in range(n):
    s = s + x[i]*u[i]
print(s)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(n):
  a, t = input().split()
  if t == 'JPY':
    ans += int(a)
  elif t == 'BTC':
    ans += float(a) * 380000.0
print(ans)

Submission status: Accepted

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

for _ in range(n):
    L = list(input().split())
    if L[1] == "JPY":
        tot += int(L[0])
    else:
        tot += float(L[0])*380000.0

print(tot)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC119 B
N = int(input())
ans = 0
for i in range(N):
    x, v = input().split()
    x = float(x)
    if v == "BTC":
        x *= 380000
    ans += x 
print(ans)