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

    """ convenient functions
    
    
    
    
    
    """

    """convenient decorator
    
    
        
        
        
        
        
        
        
        
        
        
    """
    
    
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product 
    
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  
        b, e = 2, 0  
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict 
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest 
    from copy import deepcopy, copy 
    import operator
    from operator import itemgetter
    
    
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd 
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    
    
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) 
    def modinv(a, p = MOD):
        
        
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        
        
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    """ initialize variables and set inputs
    
        
        
    
        
        
        
        
        
    
        
        
        
        
    
        
        
    """

    
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    
    
    
    
    
    
    
    """

    if __name__ != '__main__':
        
        sys.stdin = open('sample.txt')

    
    

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

    """memo: how to use defaultdict of list
    
    Dic = defaultdict(list)
    
    Dic[x].append(y)
    
    for k, v in Dic.items():
    """

if __name__ == '__main__':
    main()

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

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

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

total = 0
for i in xu:
  if i[1]=='BTC':
    total += 380000 * float(i[0])
  else:
    total += int(i[0])
print(total)

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

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

Money = [[] for _ in range(N)]
for i in range(N):
    Money[i] = input().split()

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

print(cnt)

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())
info=[]
for i in range(n):
    info.append(list(input().split()))                
total=0

for i in range(n):
    if info[i][1]=="JPY":
        total+=eval(info[i][0])
    else:
        total+=(eval(info[i][0])/0.00000001)*0.0038
print(total)

Solution (Python):
N = int(input())
c = 0
for i in range(N):
 a = list(input().split())
 if a[1] == 'BTC':
  c += float(a[0])*380000.0
 else:
  c += float(a[0])
print(c)

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

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

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

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)


main()

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

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

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

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

print(ans)

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

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

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

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

Solution (Python):



n = int(input())

bit = 0
jpy = 0

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

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

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

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

Solution (Python):


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

rate = 380000.0

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

print(ans)

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

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

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

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

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


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

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

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


    print(sum_money)


if __name__ == "__main__":
    main()

Solution (Python):

n = int(input())

ls = [input().split() for i in range(n)]
ans = [float(i[0]) if i[1] == "JPY" else float(i[0])* 380000 for i in ls]

print(sum(ans))

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

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

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

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

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

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

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

print(sum(x))

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

print(s)

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

rate_btc = 380000.0

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

    ans += x

print(ans)

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

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

out = 0

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

print(out)

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

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

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

money=0

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

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

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

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


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

print(money)

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

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

Solution (Python):
"""


 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())


 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  


a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 
"""

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

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

mod = 1000000007

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

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

otsdm = 0

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

print(otsdm)

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

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

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

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

print(sum)

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

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

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

print(ans)

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

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

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

print(sums)

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

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

for i in range(N):
  x, u = list(input().split())
  x = float(x)
  if not u == "JPY":
    x *= 380000
  ans += x
print(ans)

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

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

ans=0.0

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

print(ans)

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

Solution (Python):
from decimal import Decimal

n1 = int(input())

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

print(r1)

Solution (Python):

N = int(input())

x = [0] * N
u = [0] * N

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

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

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

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

print(ret)

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

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

Solution (Python):
n = int(input())
xu = [list(map(str,input().split())) for i in range(n)]
ans = 0
for i in range(n):
    if xu[i][1]=='JPY':
        ans += float(xu[i][0])
    else:
        ans += float(xu[i][0])*380000
print(round(ans,6))

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

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

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

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

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

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

print(ans)

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

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

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

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

Solution (Python):
N = int(input())
o = []
mon = 0
for i in range(N):
  x = input().split(' ')

  if x[1] == 'BTC':
    mon +=float(x[0])*380000
  else:
    mon +=int(x[0])
 

print(mon)

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

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

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

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

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


abc()

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

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

print(sum)

Solution (Python):
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=='JPY':
        ans+=x
    else:
        ans+=(x*380000)
print(ans)

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

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

print(answer)

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

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

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

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

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

Solution (Python):
n=int(input())
xu=[list(map(str,input().split())) for _ in range(n)]
ans=0
for i in range(n):
    if(xu[i][1]=='JPY'):
        ans+=int(xu[i][0])
    else:
        ans+=float(xu[i][0])*380000
print(ans)

Solution (Python):
n = int(input())
x = []
u = []

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

print(total)

Solution (Python):

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

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

print(ans)

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

goukei=0

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

print(goukei)

Solution (Python):
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)

N = int(input())
x, u = [''] * N, [''] * N
ans = 0.0

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

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



for i in range(0, len(lst)):
    lst[i][0] = float(lst[i][0])

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

print(ans_sum)

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

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

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

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

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

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

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

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

Solution (Python):
from decimal import *

d = Decimal(0)
y = 0

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

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

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

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

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

print(ans)

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

Solution (Python):
n = int(input())
x=[]
u=[]
for _ in range(n):
    xx,uu = map(str,input().split())
    x.append(float(xx))
    u.append(uu)
ans = 0
for i in range(n):
    if u[i]=="JPY":
        ans += x[i]
    else:
        ans += x[i]*380000
print(ans)

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

Solution (Python):


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

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

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

print(sum_otoshidama)

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

print(ans)

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

Y = 0
B = 0

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

ans = Y + 380000 * B

print(ans)

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

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

print(money)

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


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

print(sum)

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


print(x)