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:
# https://atcoder.jp/contests/abc119/tasks/abc119_b
n = int(input())
r = 0
for _ in range(n):
    x, u = input().split()
    if u == "JPY":
        r += float(x)
    else:
        r += float(x) * 380000
print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
yen = []
for i in range(N):
    xi, ui = input().split()
    xi = float(xi)
    if ui == "BTC":
        ui = 380000
    else:
        ui = 1
    yen.append(xi*ui)
print(sum(yen))

Submission status: Accepted

Solution code:
n = int(input())
gifts = [list(input().split()) for _ in range(n)]
gifts = [float(x) if u == 'JPY' else float(x) * 380000.0 for x, u in gifts]
print(sum(gifts))

Submission status: Accepted

Solution code:
def solve(string):
    n, *xu = string.split()
    return str(sum([int(x) if u == "JPY" else float(x) * 380000 for x, u in zip(xu[::2], xu[1::2])]))


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(n)])))

Submission status: Accepted

Solution code:
count = int(raw_input())
total = 0.0
for i in range(count):
    otoshidama = raw_input().split(' ')
    if otoshidama[1] == 'JPY':
        total += int(otoshidama[0])
    else:
        total += float(otoshidama[0]) * 380000
print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

    print(s)

main()

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
BTC = 380000.0

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
total = 0.0
rate = 380000.0

for i in range(N):
    a,t = input().split()
    a = float(a)
    if (t=="BTC"):
      total += a * rate
    else:
      total += a
print(total)

Submission status: Accepted

Solution code:
N = int(input())
rateBtcYen =  380000.0 
totalYen = 0
for i in range(0, N):
    amountString, currency = input().split()
    amount = float(amountString)
    if currency == "BTC":
        totalYen += amount*rateBtcYen
    else:
        totalYen += amount
print(totalYen)

Submission status: Accepted

Solution code:
number = int(input())

rate = 380000
sum_lottery = 0

for count in range(number):
    money,type = input().split()

    if (type == "JPY"):
        money = int(money)
        sum_lottery += money
    else:
        money = float(money)
        sum_lottery += money * rate

print(sum_lottery)

Submission status: Accepted

Solution code:
N= eval(input())

x = []
u = []
for it in range(N):
    tmpx, tmpu = input().split()
    x.append(eval(tmpx))
    u.append(tmpu)

count = 0
for it in range(N):
	if u[it] == 'JPY':
		count += x[it]
	elif u[it] == 'BTC':
		count += x[it]*380000.0

print(count)

Submission status: Accepted

Solution code:
N = int(input())
L = []
Su = []
for i in range(N):
    L.append(list(input().split()))
    if L[i][1]=="JPY":
        Su.append(int(L[i][0]))
    else:
        Su.append(380000*float(L[i][0]))
print(sum(Su))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

money=list(input().split(' ') for _ in range(N))

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

print(sum)

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

B2Y = 380000.0

otoshidama = 0

for item in money:
    if item[1] == 'JPY':
        otoshidama += float(item[0])
    else:
        otoshidama += float(item[0])*B2Y

print(otoshidama)

Submission status: Accepted

Solution code:
import sys

z = 0
for line in sys.stdin:
  xs = line.split()
  if len(xs) < 2:
    continue
  if xs[1] == 'BTC':
    z += 380000 * float(xs[0])
  else: 
    z += float(xs[0])
print(z)

Submission status: Accepted

Solution code:
N=int(input())

answer=0
for _ in range(N):
  money_str,unit=input().split()
  money=float(money_str)
  if unit == "BTC":
    money*=380000
  answer += money
  
print(answer)

Submission status: Accepted

Solution code:
N = int(input())

answer=0
for _ in range(N):
    money_str, unit = input().split()
    money = float(money_str)
    if unit == "BTC":
        money *= 380000
    answer += money

print(answer)

Submission status: Accepted

Solution code:
N = int(input())

sumOtoshidama = 0
for _ in range(N):
    amountStr, unit = input().split()
    amount = float(amountStr)
    if unit == "BTC":
        amount *= 380000
    sumOtoshidama += amount

print(sumOtoshidama)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
sum = 0.0
for i in range(num):
  row = input().split()
  crr = row[1]
  if (crr == "BTC"):
    val = float(row[0])
    val *= 380000.0
  else:
    val = int(row[0])
  sum = sum+val
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
a = []
a.append([0,0])
for i in range(n):
    in1, in2 = map(str, input().split())
    a.append([float(in1),in2])

ans = 0

for i in range(n):
    j = i + 1
    if a[j][1] == 'BTC':
        ans += a[j][0]*380000
    else :
        ans += a[j][0]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

value = 0
converter = {
    'JPY' : 1,
    'BTC' : 380000
}
for v in vectors:
    x, u = v
    value += float(x) * converter.get(u)

print(value)

Submission status: Accepted

Solution code:
n = int(input(), 10)
x = []
u = []
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
xn, un =[0]*N, [0]*N
for i in range(N):
    xn[i], un[i] = map(str,input().split())

ans = 0
for i in range(N):
    if un[i] == "JPY":
        ans += float(xn[i])
    if un[i] == "BTC":
        ans += float(xn[i])*380000
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
BTC_to_JPY=380000.0
price_sum=0

for i in range(N):
  price,currency=input().split()
  price=float(price)
  if currency == 'BTC':
    price=BTC_to_JPY*price
    
  price_sum=price_sum+price
  
print(price_sum)

Submission status: Accepted

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

value = 0
converter = {
    'JPY' : 1,
    'BTC' : 380000
}
for v in vectors:
    x, u = v
    value += float(x) * converter.get(u)

print(value)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    total = 0
    for i in range(N):
        money,currency = input().split()
        if currency == "JPY":
            total += float(money)
        else:
            total += float(money)*380000
    print(total)
main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    total = 0
    for i in range(N):
        money,currency = input().split()
        if currency == "JPY":
            total += float(money)
        else:
            total += float(money)*380000
    print(total)
main()

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
X = []; U = []
for i in range(n):
    x,u = input().split()
    X.append(float(x)); U.append(1 if u == 'JPY' else 3.8e5)
X = np.array(X); U = np.array(U)
print(np.dot(X,U))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while num > 0:
  a,b = input().split(" ")
  if b == "JPY":
    sum += int(a)
    
  else:
    c = float(a) * 380000
    sum += c
  num -= 1    
print(sum)

Submission status: Accepted

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

btc_yen = 380000

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for _ in range(N):
    l = input().split()
    val = float(l[0])
    cur = l[1]
    if cur == 'BTC':
        val *= 380000
    ans += val
print(ans)

Submission status: Accepted

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


print(total)

Submission status: Accepted

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

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

Submission status: Accepted

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

sum1=0
for a in t:
    
    if a[1]=="JPY":
        sum1+=int(a[0])
    else:
        sum1+=float(a[0])*380000.0

print(sum1)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

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

print(total)

Submission status: Accepted

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

for i in range(N):
    xu = input()
    xutable = xu.split()
    if xutable[1] == "JPY":
        amount += float(xutable[0])
    elif xutable[1] == "BTC":
        amount += float(xutable[0])*380000.0

print(amount)

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

Submission status: Accepted

Solution code:
N = int(input())
x = [0]*N
for i in range(N):
    a,b = input().split()
    a = float(a)
    if(b=='BTC'):
        a *= 380000.0
    x[i] = a
print(sum(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
x_list, n_list = [], []
for i in range(N):
  xi, ni = input().split(' ')
  x_list.append(float(xi))
  n_list.append(ni)
  
result = 0
for i in range(len(n_list)):
  result += x_list[i] if n_list[i] == "JPY" else x_list[i] * 380000.0
  
print(result)

Submission status: Accepted

Solution code:
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))

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

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

Submission status: Accepted

Solution code:
N = int(input())
jp = 0
bt = 0.0
btrate = 380000.0
for i in range(N):
    money = list(input().split())
    if money[1] == "JPY":
        jp += int(money[0])
    else:
        bt += float(money[0])*btrate
print(str(float(jp) + bt))

Submission status: Accepted

Solution code:
N = int(input()) # 2<=N<=10

yen = 0
btc = 0.0

data = []

for i in range(N):
    data = []
    data = input().split()
    typ  = data[1]

    if typ == 'BTC':
        btc = btc + float(data[0])
    elif typ == 'JPY':
        yen = yen + int(data[0])

#print(yen, btc)

total = float(yen) + btc * 380000.0

print(total)

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

Solution code:
ans = 0.0
for i in range(input()):
	val, tmp = raw_input().split()
	val = float(val)
	if tmp == "JPY":
		ans += val
	else:
		ans += 380000*val
print ans

Submission status: Accepted

Solution code:

N = input()
input = [input() for i in range(int(N))]

temp = []
for s in input:
  v, k = s.split()
  if k == "BTC":
    temp.append(float(v)*380000)
  else:
    temp.append(float(v))

print(sum(temp))

Submission status: Accepted

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

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians, log10
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul, xor
from copy import copy, deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits
from datetime import date

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N=INT()

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

Submission status: Accepted

Solution code:
n=int(input())
oto=[]
count=0
for x in range(0,n):
  a,b=input().split()
  oto.append([a,b])
  oto[x][0]=float(oto[x][0])
  if oto[x][1]=="BTC":
      oto[x][0]=oto[x][0]*380000
  count+=oto[x][0]
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
c = 0.0

for i in range(n) :
    x,u = map(str,input().split())
    c += int(x) if u=='JPY' else 380000.0*float(x)

print(c)

Submission status: Accepted

Solution code:
def change(x, u):
  if u == "JPY":
    return x
  else:
    return 380000.0 * x

N = int(input())
total = 0
for i in range(N):
  x, u = input().split()
  x = float(x)
  total += change(x, u)
print(total)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0.0

for i in range(N):
    xi, ui = map(str, input().split())
    ans += float(xi) if ui == "JPY" else 380000.0 * float(xi)

print(ans)

Submission status: Accepted

Solution code:
n = int(raw_input())

jpy = 0.0
btc_to_jpy = 380000.0

for i in range(0, n):
  v, c = raw_input().split()
  c = c.upper()
  v = float(v)
  if 'JPY' == c:
    jpy += v
  elif 'BTC' == c:
    jpy += v*btc_to_jpy

print jpy

Submission status: Accepted

Solution code:
n = int(input())
total = 0
for i in range(n):
    a = input().split()
    value = float(a[0])
    type = str(a[1])

    if type == 'JPY':
        total += value
    elif type == 'BTC':
        total += value * 380000
    else:
        pass
print(total)

Submission status: Accepted

Solution code:
n = int(input())
btc = 380000.0
total = 0
i = 0
while i < n:
    x, u = input().split()
    if u == 'JPY':
        total += float(x)
    else:
        total += float(x) * btc
    i += 1
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 19:05:56 2019

@author: yuta
"""

N = int(input())
money = [list(input().split()) for _ in range(N)]

def main(m):
    otoshidama = 0
    for i in range(len(m)):
        if m[i][1] == "JPY":
            otoshidama += (int(m[i][0]))
        else:
            otoshidama += (float(m[i][0])*380000)
    print(otoshidama)
main(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(sum([ eval(input().replace(" ","*").replace("JPY","1").replace("BTC","380000.0")) for i in range(int(input())) ]))

Submission status: Accepted

Solution code:
t=0
for i in range(int(input())):
    s,a=input().split()
    t+=int(s)if a=="JPY"else float(s)*38e4
print(t)

Submission status: Accepted

Solution code:
class Solver:

    def __init__(self):
        pass

    def solve(self, incomess):
        RATE = 380000.0
        y = 0.0
        for (x, u) in incomess:
            if u == 'BTC':
                y += RATE * x
            else:
                y += x
        return y


if __name__ == '__main__':

    solver = Solver()

    incomess = []
    n = int(input())
    for _ in range(n):
        input_split = input().split()
        x = float(input_split[0])
        u = input_split[1]
        incomess.append((x, u))

    y = solver.solve(incomess)
    print(y)

Submission status: Accepted

Solution code:
N = int(input())
xu = [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(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
X = []
U = []
for i in range(N):
    I = input().split()
    (x, u) = (float(I[0]), I[1])
    X.append(x)
    U.append(u)

otoshidama = 0.0

for i in range(N):
    if U[i] == "JPY":
        otoshidama += X[i]
    elif U[i] == "BTC":
        otoshidama += X[i] * 380000.0

print(otoshidama)

Submission status: Accepted

Solution code:
n = int(input())
sum = 0
for i in range(n):
    tmp_inputs = input().split()
    tmp_value = float(tmp_inputs[0])
    money_type = str(tmp_inputs[1])
    if money_type == 'JPY':
        sum += tmp_value
    elif money_type == 'BTC':
        sum += tmp_value * 380000
    else:
        raise
print(sum)

Submission status: Accepted

Solution code:
# coding: utf-8
bitcoin = 380000
a = int(input())
count = 0
for _ in range(a):
    x, u = input().split()
    if u == "JPY":
        count += int(x)
    else:
        count += float(x) * bitcoin
print(count)

Submission status: Accepted

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

print(all_yen)

Submission status: Accepted

Solution code:
bitcoin = 380000.0

n = int(input())
input_list = []
yen_sum = 0
for i in range(n):
    aaa = str(input())
    in_ = aaa.split(" ")
    x = float(in_[0])
    u = str(in_[1])
    if u=="JPY":
      yen_sum+=x
    else:
      yen_sum += bitcoin*x
print(yen_sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import Decimal
 
def solve():
	n = int(input())
 
	sum = Decimal("0")
	for i in range(n):
		amount, type = input().split()
		if type == "JPY":
			sum += Decimal(amount)
		else:
			sum += Decimal(amount)*Decimal("380000.0")
	return sum
  
print(solve())

Submission status: Accepted

Solution code:
RATIO = 380000

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

print(sum)

Submission status: Accepted

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

	for i in range(n):
		price, unit = input().split()
		price = float(price)
		if unit == "BTC":
			ans += price * 380000
		else:
			ans += price

	print(ans)

main()

Submission status: Accepted

Solution code:
N = int(input())

list_money = []

while len(list_money) < N:
	list_add = list(input().split())
	list_money.append(list_add)

total_money = 0

for i in range(N):
	list_family_i = list_money[i]
	x_i = float(list_family_i[0])
	u_i = list_family_i[1]
	
	if u_i == 'BTC':
		x_i *= 380000.0
		total_money += x_i
	else:
		total_money += x_i

print(total_money)

Submission status: Accepted

Solution code:
n = int(input())
otosidama_list = list()

for i in range(n):
    otosidama_list.append(list(input().split()))

goukei = 0

for i in range(len(otosidama_list)):
    if otosidama_list[i][1] == "BTC":
        goukei += float(otosidama_list[i][0]) * 380000
    else:
        goukei += int(otosidama_list[i][0])
print(goukei)

Submission status: Accepted

Solution code:
n = int(input())
sum = 0
for i in range(n):
  amount, name = input().split()
  amount = float(amount)
  if name == "BTC":
    sum += 380000 * amount
  else:
    sum += amount

print(sum)

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().split()[0])
res = 0
for _ in range(N):
  __ = stdin.readline().split()
  x, u = float(__[0]), __[1]
  if u=="BTC":
    res += x * 380000.0
  else:
    res += x

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
x = []
u = []
ans = 0
for i in range(0,N):
  s = input().split()
  x.append(float(s[0]))
  u.append(str(s[1]))
for i in range(0,N):
  if u[i] == 'BTC':
    ans = ans + x[i] * 380000.0
  else:
    ans = ans + x[i]
print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8
n = int(input())
ans = float(0)
for i in range(n):
    price_str, type = map(str, input().split())
    price = float(price_str)
    if type == "JPY":
        ans += price
    else:
        ans += 380000 * price
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":
        ans+=x*380000.0
    else:
        ans+=x
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
from decimal import Decimal
for i in range(N) :
    i = input().split()
    if i[1] == "BTC":
        A = Decimal(i[0])*380000
    else:
        A = int(i[0])
    ans += A
print(ans)

Submission status: Accepted

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

for _ in range(n):

    amount, currency = input().split()

    amount = float(amount)

    if currency == 'JPY':
        ans += amount
    else:
        ans += 380000 * amount

print(ans)

Submission status: Accepted

Solution code:
a = int(input())

b = []
for i in range(a):
    c = input().split(' ')
    b.append(c)

total = 0
for j in range(a):
    if b[j][1] == 'JPY':
        total += float(b[j][0])
    else:
        total += float(b[j][0]) * 380000

print(total)

Submission status: Accepted

Solution code:
N = int(input())
s = 0.0
for i in range(N):
    l = input().split()
    if l[1]=='BTC':
        s += float(l[0]) * 380000.0
    else:
        s += float(l[0])
print(s)

Submission status: Accepted

Solution code:
ninzu=input()
dama_sum=0

for a in range(int(ninzu)):
    dama=input()
    dama_spl=dama.split(" ")
    if dama_spl[1]=="JPY":
        r=1
    else:
        r=380000
    dama_sum += float(dama_spl[0])*r
print(dama_sum)