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

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())
x = [list(input().split()) for _ in range(n)]
ans = 0

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

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

ans = 0
for i in range(N):
    if ulist[i] == 'JPY':
        ans += xlist[i]
    else:
        ans += 380000.0 * xlist[i]

print(ans)

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

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

Solution (Python):

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

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

sum = 0
for i in range(N):
    if xu[i][1] == 'JPY':
        sum += int(xu[i][0])
    else:
        sum += float(xu[i][0]) * 380000
print(sum)

Solution (Python):
ans = 0
for _ in range(int(input())):
    pri,uni = input().split()
    if uni == "BTC":ans += float(pri)*3.8e5
    else:ans += int(pri)
print(ans)

Solution (Python):
pri,uni = 0,0
jsum,bsum = 0,0
for _ in range(int(input())):
    pri,uni = input().split()
    pri = float(pri)
    if uni == "JPY":jsum += pri
    else:bsum += pri
print(jsum + bsum*3.8e5)

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

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

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

l = [[i for i in input().split()] for _ in range(n)]
ans = 0
for i in l:
    if i[1] == 'JPY':
        ans += float(i[0])
    else:
        ans += float(i[0])*380000

print(ans)

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

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

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
ans = 0
for i in range(N):
    price, typ = input().split()
    price = float(price)
    if typ == 'BTC':
        ans += price * 380000
    else:
        ans += price
print(ans)

Solution (Python):


n = int(input())


sum = 0
for i in range(n):
    temp_x, u = input().split()
    x = float(temp_x)
    if u == "JPY":
        sum += x
    else:
        sum += x*380000.0

print(sum)

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 x*380000
print(ans)

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

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

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

cnt = 0
for n in range(N):
    if (XU[n][1] == "JPY"): cnt += int(XU[n][0])
    else: cnt += float(XU[n][0]) * 380000

print (cnt)

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

result = 0

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

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

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

result=0
for item in range(n):
  a,b=map(str,input().split())
  if b=="JPY":
    result+=float(a)
  else:
    result+=float(a)*380000.0
print(result)

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

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

Solution (Python):
n=int(input())
s = [list (input().split()) for i in range(n)]
q=[float(s[i][0]) for i in range(n)]
price=[]
for j in range(n):
  if s[j][1]=='JPY':
    price.append(1)
  elif s[j][1]=='BTC':
    price.append(380000.0)
ans=sum(q[k]*price[k] for k in range(n))
print(ans)

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

Solution (Python):
N = int(input())
A = []
BTC = 380000.0
ans = 0
for _ in range(N):
    x,u = input().split()
    tmp = (float(x),u)
    A.append(tmp)
for a in A:
    x = a[0]
    u = a[1]
    if u == "JPY":
        ans += x
    else:
        ans += x*BTC
print(ans)

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

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

Solution (Python):
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
  x[i], u[i] = map(str, input().split())
conv = 380000
total = 0
for i in range(N):
  if u[i] == 'BTC':
    x[i] = conv * float(x[i])
  total += float(x[i])
print(total)

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

def get():
    x, u = input().split()
    if u == "JPY":
        return float(x)
    else:
        return float(x) * 380000.0

ans = sum([get() for i in range(N)])
print(ans)

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

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

ans = 0
for i in range(N):
    if List[i][1] == "JPY":
        ans += int(List[i][0])
    else:
        ans += float(List[i][0])*380000

print(ans)

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

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

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)*38*(10**4)

print(ans)

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

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

Solution (Python):
rate=380000.0 

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

Solution (Python):
N = int(input())
a = []
for _ in range(N):
    a.append(list(input().split()))
yen = 0
coin = 0.0
for i in range(N):
    if a[i][1] == 'JPY':
        yen += int(a[i][0])
    else:
        coin += float(a[i][0])
print(yen+coin*380000.0)

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

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

Solution (Python):
n = int(input())
jpy = 0
btc = 0
for _ in range(n):
  x,y = input().split()
  if y == 'JPY':
    jpy += int(x)
  elif y == 'BTC':
    btc += float(x)
print(jpy + btc * 380000.0)

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.0
    else :
        ans += 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.0
    else:
        ans += x
print(ans)

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

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

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

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

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

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

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 * 38 * 10 ** 4
print(total)

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

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

Solution (Python):
n=0
for _ in range(int(input())):
  x,y=input().split()
  if(y=='BTC'):
    n+=float(x)*38e4
  else:
    n+=float(x)
print(n)

Solution (Python):
N = int(input())
M = [input().split() for i in range(N)]
ans = 0
for i in range(N):
    ans += float(M[i][0])*(380000*(int(M[i][1]=="BTC"))+(int(M[i][1]=="JPY")))
print(ans)

Solution (Python):
n = int(input())
xu = list(input().split() for _ in range(n))
m = 0.0
for i in range(n):
  if xu[i][1] == 'JPY':
    m = m + int(xu[i][0])
    xu[i][0]
  else:
    m = m + 380000.0*float(xu[i][0])
print(m)

Solution (Python):
def exchange(btc):
  return 380000.0 * btc
 
n = int(input())
sum = 0.0
for i in range(n):
  a, b = input().split()
  if "JPY" in b:
    sum += float(a)
  else:
    sum += exchange(float(a))
 
print(sum)

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

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

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

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

ans = 0
for _ in range(n):
    value, typ = input().split()

    if typ == 'JPY':
        ans += int(value)
    else:
        ans += float(value) * 380000

print(ans)

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

Solution (Python):
n = int(input())
i_l=[]
k_l=[]
for a in range(n):
    i = input().split()
    if i[1]=='BTC':
        i_l.append(float(i[0]))
    else:
        k_l.append(int(i[0]))

q=sum(k_l)
print(sum(i_l)*380000+q)

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

Solution (Python):



N = int(input())
x = [list(map(str, input().split())) for _ in range(N)]
tmp = []
for i in range(N):
    if x[i][1] == 'JPY':
        tmp.append(float(x[i][0]))
    else:
        tmp.append(float(x[i][0]) * 380000)
print(sum(tmp))

Solution (Python):
"""
【ABC119】
B - Digital Gifts



import sys


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def SS(): return sys.stdin.readline().rstrip().split()
def S(): return sys.stdin.readline().rstrip()

sum = 0
N = II()
for i in range(N):
    x, y = SS()
    if y == "JPY":
        sum += float(x)
    else:
        sum += float(x)*380000
print(sum)

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

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

score = 0
for x, u in otc:
    if u == "JPY":
        score += float(x)
    if u == "BTC":
        score += 380000 * float(x)

print(score)

Solution (Python):
n= int(input())
ans=0.0
for i 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())
BTC = 380000.0
t = 0

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

print(t)

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

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

print(s)

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

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())
sum = 0
rate = 380000
for i in range(n):
    money ,kind = input().split()
    if kind == "JPY":
        sum += int(money)
    else:
        sum += float(money) * rate
print(sum)

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

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

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

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

Solution (Python):
import sys
input=sys.stdin.readline

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

if __name__ == '__main__':
    main()

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

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

ans = 0
for n in L:
    ans += float(n[0]) * 380000.0 if n[1] == 'BTC' else float(n[0])

print(ans)

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

Solution (Python):
import sys
input = sys.stdin.readline


N = int(input())
xu = [input().split() for _ in range(N)]
ans=0
for i in range(N):
    if xu[i][1] == "BTC":
        ans+=float(xu[i][0])*380000
    else:
        ans+=float(xu[i][0])
print(ans)

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

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

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

BTC_EXCHANGE_RATE = 380000

money = 0
for _ in range(n):
    x, u = input().split()
    x = float(x)
    money += [x, x*BTC_EXCHANGE_RATE][u == 'BTC']

print(money)

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

Solution (Python):
N = int(input())
XU = [input().split() for _ in range(N)]
count = 0
for xu in XU:
    if xu[1] == 'JPY':
        count += int(xu[0])
    else:
        count += float(xu[0]) * 380000
print(count)

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

ans=0
for xu in xus:
  if xu[-1]=='JPY':
    ans+=float(xu[0])
  else:
    ans+=380000.0*float(xu[0])
print(ans)

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

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

main()

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

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

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

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

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

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

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

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

Solution (Python):
n=int(input())
o=[]
bit=0
jp=0
for i in range(n):
    o.append(input().split())
    if o[i][1]=='BTC':
        bit+=float(o[i][0])
    else:
        jp+=int(o[i][0])
print(jp+380000*bit)

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

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

print(Answer)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
x = [0] * N
u = [0] * N
for i in range(N):
	x[i], u[i] = input().split()

ans = 0
for i in range(N):
	if u[i] == "JPY":
		ans += float(x[i])
	else:
		ans += float(x[i]) * 380000
print(ans)

Solution (Python):
N = int(input())
kingaku = []
tanni = []

otoshidama = 0.0
for i in range(N):
    k, t = input().split()
    if t == 'BTC':
        otoshidama += float(k) * 380000.0
    else:
        otoshidama += int(k)

print(otoshidama)

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

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

print(ans)

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

Solution (Python):
N = int(input())
sum1 = 0.0
for _ in range(N):
    data = input().split()
    if data[1] == 'JPY':
        sum1 += int(data[0])
    else:
        sum1 += float(data[0])* 380000.0
print(sum1)

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

res = 0.0

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

print(res)

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

for j in range(n):
  if xu[j][1] == "BTC":
    s += float(xu[j][0])*380000
  else:
    s += float(xu[j][0])
    
print(s)

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

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + float(xu[j][0])*380000
  else:
    sigma = sigma + float(xu[j][0])
    
print(sigma)

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

sum = 0.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())

btc = []
yen = []

for i in range(N):
  x,y = map(str,input().split())
  if y == "JPY":
    yen.append(float(x))
  else:
    btc.append(float(x))

print(sum(btc)*380000.0 + sum(yen))

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):
cou = 0
lo = int(input())
for i in range(lo):
    x, y = input().split()
    if y == "JPY":
        cou += float(x)
    else:
        cou += float(x) * 380000.0
print(cou)

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

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

print(ans)

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

ans = 0
for i in range(N):
    if li[i][1] == "JPY":
        ans += float(li[i][0])
    elif li[i][1] == "BTC":
        ans += float(li[i][0]) * 380000.0

print(ans)

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

Solution (Python):
n = int(input())
a = 0
for _ in range(n):
    x, n = input().split()
    a += (38*10**4)**(n == 'BTC')*float(x)
print(a)

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

jpy=[]
btc=[]

for i in range(n):
    x,u=input().split()
    if u=="JPY":
        jpy.append(float(x))

    else:
        btc.append(float(x)*380000.0)




print(sum(jpy)+sum(btc))

Solution (Python):
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = float(x) * 3.8e5
  count += x
print(count)

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

    return tot

if __name__ == '__main__':
    print(main())

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

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

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
n = int(input())
otoshidama = {"JPY":0, "BTC":0}
for i in range(n):
    a, b = map(str, input().split())
    a = float(a)
    if b == "JPY":
        otoshidama["JPY"] = otoshidama["JPY"] + a
    else:
        otoshidama["BTC"] = otoshidama["BTC"] + a
ans = otoshidama["JPY"] + otoshidama["BTC"] * 380000.0
print(ans)

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

Solution (Python):

N=int(input())
X=[]
U=[]
s=0
for i in range(N):
    x,u=map(str, input().split())
    X.append(float(x))
    U.append(u)
for i in range(N):
    if U[i]=="JPY":
        s+=X[i]
    else:
        s+=X[i]*380000.0
print(s)

Solution (Python):
btc = 380000
N = int(input())
ans = 0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
        x *= btc
    ans += 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 *= 380000.0
  ans += x
print(ans)

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

print(ans)

Solution (Python):
n = int(input())
money = []
measure = []
for _ in range(n):
  mo,me = input().split()
  money.append(float(mo))
  measure.append(me)
for i in range(n):
  if measure[i]=='BTC':
    money[i] *= 380000.0
print(sum(money))

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

Solution (Python):
N=int(input())
x=[]
u=[]
for n in range(N):
  X,U=input().split()
  if "." in X:
    X=float(X)
  else:
    X=int(X)
  x.append(X)
  u.append(U)
s=[]
for i in range(N):
  if u[i]=="JPY":
    s.append(x[i])
  elif u[i]=="BTC":
    s.append(x[i]*380000.0)
print(sum(s))

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

def calc_value(l):
	if l[1] == "BTC":
		l[0] = 380000.0 * l[0]
	return l[0]
	
total = 0
for i in range(n):
	total += calc_value(otoshidama[i])

print(total)

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

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

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

Solution (Python):
rate = 380000.0
summary = 0
for i in range(int(input())):
  line = input().split()
  if line[1] == 'JPY':
    summary += float(line[0])
  else:
    summary += float(line[0]) * rate
print(summary)

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

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

sum=0

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

print(sum)

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