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.

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):
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()

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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


print(total)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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))

Solution (Python):
N = int(input()) 

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



total = float(yen) + btc * 380000.0

print(total)

Solution (Python):
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)

Solution (Python):
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

Solution (Python):

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

Solution (Python):


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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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

Solution (Python):
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)

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

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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())

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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)

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):


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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):


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

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

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
n = int(input())
c = []
for i in range(n):
    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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):





















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)

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):

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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)
    
total = sum(x)
print(total)

Solution (Python):
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)

Solution (Python):



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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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())

Solution (Python):
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)

Solution (Python):


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

Solution (Python):
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)

Solution (Python):



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

Solution (Python):
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)