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 = input()
ans = 0.0
for _ in range(N):
  x, u = raw_input().split()
  if u=="JPY":
    ans += float(x)
  else:
    ans += float(x)*380000
print ans

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('{:.11f}'.format(ans))

Solution (Python):
import sys

lines = sys.stdin.readlines()

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

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

print(totalCount)

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

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

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

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

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

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

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

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

ans = 0

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

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

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

print(ans)

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

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 += int(x)
print(ans)

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys

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


if __name__ == '__main__':
  main()

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

print(sum)

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

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

print(ans)

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

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

print(ans)

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

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

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

print(ans)

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

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

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

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


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

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



print(main())

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

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

print(sum(listB))

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

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

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

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

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

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

Solution (Python):
N = int(input())
X = [0]*N
U = [0]*N

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

print(sum_)

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

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

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

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

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

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

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

jpy=0
btc=0.0

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

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

print(jpy + btc* 380000.0 )

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

Solution (Python):


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

sys.setrecursionlimit(1000000)

INF = 10 ** 18

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

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

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

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

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

sum= 0

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

print(sum)

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

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

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

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

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

print(sum(S))

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

print(ans)

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

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

print(ans)

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

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

print(jpysum+btcsum*btcprice)

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

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

print(C)

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

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

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

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

Solution (Python):


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

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

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

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

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

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

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

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

print(sum_m)

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

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

print(summon)

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

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

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

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

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

Solution (Python):


import sys


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

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


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

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

Solution (Python):
N = input()

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

    sum = sum + x

print(sum)

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

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

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

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

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

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

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

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

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

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

ans = 0.0
for _ in range(n):
    x, u = input().split()
    k = 1
    if u != "JPY":
        k = 380000
    ans += k * float(x)

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("{:.11f}".format(ans))

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

x = []
u = []
sum_m = []

for i in range(N):
    j, k = input().split(' ')
    if k == 'JPY':
        sum_m.append(int(j))
        x.append(int(j))
    elif k == 'BTC':
        sum_m.append(float(j) * 380000.0)
        x.append(float(j))
    u.append(k)

print(sum(sum_m))

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())
f = 0
k = 0
a = []
for i in range(n) :
    a = input().split()
    if a[1] == "JPY" :
        f +=  float(a[0])
    else :
        k += float(a[0])
print(f + k *380000 )

Solution (Python):
N = int(input())
rate = 380000.0
ans = 0.0
for _ in range(N):
    x, u = input().split()
    x = float(x)

    ans += x * (rate if u == 'BTC' else 1)
print('{:.11f}'.format(ans))

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

Solution (Python):
print(sum([float(x)*{"JPY":1,"BTC":380000}[u] for i in range(int(input())) for x,u in ([input().split()])]))

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    x, u = map(str, input().split())

    if u == 'JPY':
        ans += int(x)
    else:
        ans += (380000 * float(x))

print(ans)

Solution (Python):
N = int(raw_input())
total = 0
for i in range(N):
    xi_, ui = raw_input().split()
    if ui == 'JPY':
        xi = int(xi_)
        total += xi
    else:
        xi = float(xi_)
        total += 380000.0 * xi
print total

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('{:.11f}'.format(ans))

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

x = []

for _ in range(N):
  inp = input().split(' ')
  if inp[1] == 'JPY':
    x.append(int(inp[0]))
  else:
    x.append(float(inp[0]) * 380000.0)


sum = 0

for i in range(N):
  sum += x[i]

print(sum)

Solution (Python):
XU=[input().split() for i in range(int(input()))]
print(sum([float(x)*{"JPY":1,"BTC":380000}[u] for x,u in XU]))

Solution (Python):
a = int(input())
total = 0
for _ in range(a):
    i = input()
    v,c = i.split()
    v = float(v)
    if(c=="BTC"):
        v *= 380000
    total += v
print(total)

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

Solution (Python):


a=int(input())
    
b=[]   

c=0.0
    

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

Solution (Python):
JP = 0
BC = 0.0

N = int(input())

for i in range(0,N):
    mon, rate = input().split()
    if (rate == "JPY"):
        JP += int(mon)
    else:
        BC += float(mon)
sum = JP + 380000.0 * BC
print(sum)

Solution (Python):
n,*a=open(0).read().split();f=float;print(sum([f(a[s])*380000.0,f(a[s])][a[s+1]=="JPY"]for s in range(0,int(n)*2,2)))

Solution (Python):
n,*a=open(0).read().split();print(sum([float(a[s])*380000.0,float(a[s])][a[s+1]=="JPY"] for s in range(0,int(n)*2,2)))

Solution (Python):
n=int(input())
x=[list(input().split()) for _ in range(n)]
ans=0
for i in range(n):
        if x[i][1] == "JPY":
                ans+=float(x[i][0])
        else:
                ans+=float(x[i][0])*380000
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

print(total)

Solution (Python):
i=0
sum =0
N=int(input())

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

    sum += x

print(sum)

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

b = []

for i in range(a):
    b.append(input().split())

res = 0

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

print(res)

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

ss=[]
for i in range(N):
    if a[i][1] == 'JPY':
        ss.append( float(a[i][0]))
    elif a[i][1] == 'BTC':
        ss.append(float(a[i][0])*380000.0)

print(sum(ss))

Solution (Python):




def solveProblem(personNumber):
	sumPrice = 0.0
	personRange = range(0,personNumber,+1)
	for _ in personRange:
		price,kahei = map(str,input().strip().split(' '))
		if(kahei == "BTC"):
			floatPrice = float(price)
			sumPrice = sumPrice + 380000.0 * floatPrice
		else:
			intPrice = float(price)
			sumPrice = sumPrice + intPrice
	answer = sumPrice
	return answer


if __name__ == '__main__':
	N = int(input().strip())
	solution = solveProblem(N)
	print("{}".format(solution))

Solution (Python):
N = int(input())
X, U = [], []
for i in range(N):
    x, u = input().split(" ")
    X.append(float(x))
    U.append(u)

ans = 0
for i in range(N):
    if U[i] == 'BTC':
        ans += X[i] * 380000
    else:
        ans += X[i]
print(ans)

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

Solution (Python):
N = int(input())
s = [input() for i in range(N)]

count =0

for i in range(N):

    BTCindex =  s[i].find("BTC")
    if BTCindex != -1:
        BTC_strip = ((s[i]).strip("BTC"""))
        count +=(float(BTC_strip)*380000.0)
    
    JPYindex =  s[i].find("JPY")
    if JPYindex != -1:
        JPY_strip = ((s[i]).strip("JPY"""))
        count +=(float(JPY_strip))


print(count)

Solution (Python):

def B():
    jpy='JPY'
    btc='BTC'
    rate_from_btc_to_jpy=380000

    N = int(input())
    x_list=[]
    u_list=[]
    for i in range(N):
        x, u = (x for x in input().split())
        x = float(x)
        x_list.append(x)
        u_list.append(u)
    
    otoshidama = 0
    for i in range(len(u_list)):
        if u_list[i] == jpy:
            otoshidama = otoshidama + x_list[i]
        elif u_list[i] == btc:
            otoshidama = otoshidama + x_list[i] * rate_from_btc_to_jpy
    
    print(otoshidama)

if __name__== '__main__':
    B()

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

Ans = []

for i in range(N):
    if xu[i][1] == "JPY":
        Ans.append(int(xu[i][0]))
    else:
        Ans.append(float(xu[i][0]) * 380000)

print(sum(Ans))

Solution (Python):
total = 0

relatives = int(input())
input_array = [input() for i in range(relatives)]

for input_string in input_array:
  price_type = input_string.split()
  if price_type[1] == 'JPY':
    total += float(price_type[0])
  else:
    total += float(price_type[0]) * 380000
    
print(total)

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

Solution (Python):

n = int(input())

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

print(sum)

Solution (Python):
print(sum(float(s[:-4])*(s[-4]>'C'or 380000)for s in open(0).readlines()[1:]))

Solution (Python):
BTCIN = 'BTC'
BTCTAN = 380000.0
inNinzu = int(input())
okaneList = [[0 for i in range(2)] for j in range(inNinzu)]
okaneAns = 0.0
for i in range(0, inNinzu):
    inOkane = input().split(' ')
    if inOkane[1] == BTCIN:
        okaneAns += float(inOkane[0]) * BTCTAN
    else:
        okaneAns += float(inOkane[0])

print(okaneAns)

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

Solution (Python):
N=int(input())
list = []
for i in range(N):
  a, b = input().split()
  list1 = [a, b]
  list.append(list1)
 
sum = 0.0
bin = 0.00000000
for i in range(len(list)):
  if list[i][1] == "JPY":
    sum += float(list[i][0])
  else:
    bin += float(list[i][0])
all = sum + (bin * 380000.0)
print(all)

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

money_bit_all = 0
money_all = 0

for i in range(a):
    money_bit = 0
    if 'BTC' in b[i]:
        money_bit = 380000.0 * float(b[i][0])
        money_bit_all = money_bit_all + money_bit

    else:
        money_all = money_all + float(b[i][0])

print(money_all + money_bit_all)

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

for i in range(n):
    if u[i]=="BTC":
        x[i]=x[i]*380000.0
    sum+=x[i]

print(sum)

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import math
import bisect
import random
def LI(): return list(map(int, input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return list(input())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
mod = 1000000007


"""
s = input().split("/")
if int(s[0]) > 2019:
    print("TBD")
elif int(s[0]) == 2019:
    if int(s[1]) > 4:
        print("TBD")
    elif int(s[1]) == 4:
        if int(s[2]) > 30:
            print("TBD")
        else:
            print("Heisei")
    else:
        print("Heisei")
else:
    print("Heisei")
"""


n = I()
ans = 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)

"""
n,a,b,c = LI()
l = IR(n)
f = [True for i in range(3)]
ans = 0
for i in range(n):
    for d in range(3):
        if abs(l[i]-[a,b,c][d]) <= 10 and f[d]:
            ans += abs(l[i]-[a,b,c][d])
            f[d] = False
            l[i] = -float("inf")
k = False
for i in f:
    if i:
        k = True
        break
if not k:
    print(ans)
    quit()
"""

"""
a,b,q = LI()
s = IR(a)
t = IR(b)
for i in range(q):
    x = I()
    c = bisect.bisect_left(s,x)
    ans = float("inf")
    k = abs(x-s[c-1])
    y = s[c-1]
    d = bisect.bisect_left(t,y)
    ans = min(ans,k+abs(y-t[d-1]))
    if d < b:
        ans = min(ans,k+abs(y-t[d-1]),min(abs(x-s[c-1]),abs(t[d]-x))+abs(t[d]-s[c-1]))
    ans = min(k,ans)
    if c < a:
        k = abs(x-s[c])
        y = s[c]
        d = bisect.bisect_left(t,y)
        if d == b:
            if t[-1] < x:
                k = min(s[c]-x,x-t[d-1])+s[c]-t[d-1]
        else:
            if abs(y-t[d-1]) < abs(y-t[d]):
                if t[d-1] < x:
                    k = min(s[c]-x,x-t[d-1])+s[c]-t[d-1]
            else:
                k += abs(y-t[d])
        ans = min(k,ans)
    print(ans)
"""

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

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

print(sum)

Solution (Python):
n=int(input())
x=[]
u=[]
for i in range(n):
    y,z=input().split()
    x.append(y)
    u.append(z)
v=0
for i in range(n):
    if u[i]=='JPY':
        v+=int(x[i])*1
    else: 
        v+=float(x[i])*380000
print(v)

Solution (Python):
s = input()
money = 0
for i in range(int(s)):
  str_money = input()
  temp = str_money.split(" ")
  if temp[1] == "JPY":
    money += float(temp[0])
  else:
    money += 380000.0 * float(temp[0])
print(money)

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

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

Solution (Python):
import math
from sys import stdin

N = input()
total = 0
for i in range(int(N)):
  x, u = stdin.readline().rstrip().split() 
  if u=='JPY':
    total=float(x)+total
  else:
    total += float(380000*float(x))
      
print('%f'%total)

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

Solution (Python):
print(sum(float(s[:-4])*[380000,1][s[-4]>'C']for s in open(0).readlines()[1:]))

Solution (Python):
import sys

def main():
    line_num = int(sys.stdin.readline().strip())
    sum_total = 0.0
    for i in range(line_num):
        line = sys.stdin.readline().strip()
        qua, cur = line.split(" ")
        if cur == "BTC":
            sum_total += 380000.0 * float(qua)
        else:
            sum_total += float(qua)
    print(sum_total)

if __name__ == "__main__":
    main()