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

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
answer = 0
for _ in range(N):
    x, u = sr().split()
    if u == 'JPY':
        answer += int(x)
    else:
        answer += float(x) * 380000
print(answer)

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

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

sum = 0.0
for _ in range(N):
    x,u = input().split()
    x = float(x)
    if u=="JPY":
        sum = x + sum
        continue
    x = 380000*x
    sum = sum + x
print(sum)

Solution (Python):
icase=0
if icase==0:
    n=int(input())
    xsum=0
    for i in range(n):
        xi,ui=input().split()
        if ui=="JPY":
            xsum=xsum+int(xi)
        else:
            xsum=xsum+float(xi)*380000
    print(xsum)

Solution (Python):
n = int(input())
gifts = []
for i in range(n):
    gift = input().split()
    gifts.append(gift)
ans = 0
for j in range(n):
    if gifts[j][1] == "BTC":
        price = float(gifts[j][0]) * 380000
        ans += price
    elif gifts[j][1] == "JPY":
        price = float(gifts[j][0])
        ans += price
print(ans)

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

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

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

print(Y)

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

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

print(ans)

Solution (Python):

N = int(input())

gift = 0

for _ in range(N):
    line = [s for s in input().split()]
    gift += float(line[0]) if line[1] == 'JPY' else 380000.0 * float(line[0])

print(gift)

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

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

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

print(ans)

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

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

Solution (Python):

import io

n = int(input())

array = [list(input().split()) for i in range(n)]

data = 0

for i in array:
  if i[1] == 'JPY':
    data += int(i[0])
  else:
    data += float(i[0])*380000.0
print(data)

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

print(ans)

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

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

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

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

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

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

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

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())
T = [input().split() for _ in range(n)]
ans = 0

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

print(ans)

Solution (Python):
N = int(input())
gifts = [list(map(str, input().split())) for _ in range(N)]
ans = 0
for gift in gifts:
    if gift[1] == 'JPY':
        ans += int(gift[0])
    else:
        ans += float(gift[0])*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())
x=[0]*n
u=[0]*n
k=0
b=0
for i in range(n):
  x[i],u[i]=map(str,input().split())
  x[i]=float(x[i])

for i in range(n):
  if u[i]=='JPY':
    k+=x[i]
  else:
    b+=x[i]
    
b=b*380000
print(k+b)

Solution (Python):
print(sum(eval(input().replace(" JPY", "").replace(" BTC","*380000")) for _ in range(int(input()))))

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

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

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

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

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

print(kozukai_sum)

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

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

print(ans)

Solution (Python):
import numpy as np
import sys

n = int(input())
ans = 0
for _ 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())
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 = map(str, input().split())
  ans += float(x)*(1+(379999)*(u=="BTC"))
print(ans)

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

for i in range(n):
    a, b =input().split()
    x.append(float(a))
    u.append(b)
for i in range(n):
    if u[i] == "BTC":
        x[i] =x[i]*380000
print(sum(x))

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

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

print(cnt)

Solution (Python):
n=int(input())
genkin=0
bit=0

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

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

ans = 0

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

print(ans)

Solution (Python):
n = int(input())
x = []
u = []
for i in range(n):
     a, b = input().split()
     x.append(float(a))
     u.append(b)
for i in range(n):
     if u[i] == "BTC":
          x[i] = x[i] * 380000
print(sum(x))

Solution (Python):
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) * 380000
print(ans)

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

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

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

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

Solution (Python):








import numpy as np




n = int(input())
times = n
X = []
U = []
for _ in range(times):
    x,u = input().split()
    X.append(float(x))
    u = 1 if u == "JPY" else 380000
    U.append(u)

ans = np.dot(np.array(X),np.array(U))


print(ans)

Solution (Python):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    n = II()
    BTC = 380000.0
    total = 0
    for i in range(n):
        v, t = IS().split()
        if t == 'JPY': total += int(v)
        elif t == 'BTC': total += float(v)*BTC
    print(total)

if __name__ == '__main__':
    main()

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

x=[]
u=[]

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

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

print(sum)

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

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())
gift = 0
for i in range(N):
  xu = input().split()
  x, u = float(xu[0]), xu[1]
  if u == "JPY":
    gift += x
  elif u == "BTC":
    gift += x * 380000
print(gift)

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


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())
p = 0
for i in range(n):
    x,u=input().split()
    if u=='JPY':
        p += int(x)
    else:
        p += (float(x)*380000)
print('{:.8f}'.format(p))

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

Solution (Python):
n = int(input())
ans = 0.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):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


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

    N = ii()
    ans = float(0)
    for n in range(N):
        x, u = sl()
        if u == 'JPY':
            ans += float(x)
        else:
            ans += float(x) * 380000.0
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  BTC = 380000.0
  n = int(input())
  ans = 0
  for _ in range(n):
    x,u = input().split()
    if u == 'JPY':
      ans += float(x)
    elif u == 'BTC':
      ans += float(x) * BTC
      
  print(ans)
    
    
    
    
    
if __name__ == '__main__':
  main()

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

Solution (Python):
def main():
    n = int(input())
    str_list = []
    for _ in range(n):
        str_list.append(list(input().split()))
        
    money_sum = 0
    for i in range(n):
        if str_list[i][1] == 'JPY':
            money_sum += int(str_list[i][0])
        else:
            money_sum += 380000 * float(str_list[i][0])

    print(money_sum)      

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
xu_list = [input().split() for _ in range(n)]
print(sum([int(x) if u == "JPY" else float(x) * 380000 for x, u in xu_list]))

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

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

Solution (Python):
def main():
  n = int(input())
  
  
  
  
  
  a = [input().split() for i in range(n)]
  
  ans = 0
  count = 0
  lis = []
  
  for i in range(n):
    if a[i][1] == "JPY":
      ans += int(a[i][0])
    else:
      ans += 380000*float(a[i][0])
  print(ans)
  
if __name__ == '__main__':
  main()

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

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

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

print(ans)

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
ans = 0
n = ii()

for i in range(n):
    x,u = ism()
    if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x)*380000
print(ans)

Solution (Python):
N = int(input())
xv=[]
for _ in range(N):
    xv.append(tuple(input().split()))
profit=0
for val in xv:
    if val[1]=='JPY':
        profit+=int(val[0])
    else:
        profit+=float(val[0])*380000.0


print(profit)

Solution (Python):
N = int(input()) 
X = []
btc = 380000
ans = 0
for i in range(N):
    X.append(list(map(str,input().split())))
for i in range(N):
    if X[i][1] == 'BTC':
        ans += float(X[i][0]) * btc
    else:
        ans += int(X[i][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)
    elif u =='BTC':
        ans += float(x)*380000.0

print(ans)

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

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

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

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

Solution (Python):
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
ans = 0
for _ 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())
btc = 380000
result = 0

for i in range(n):
    x,u = list(input().split())
    if u == 'BTC':
        result += float(x) * btc
    else:
        result += float(x)
print(result)

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

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ct=0
    for i in range(n):
        a,b=STRM()
        if b=='JPY':
            ct+=int(a)
        else:
            ct+=float(a)*380000
    print(ct)
if __name__ == '__main__':
    do()

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

l = []
for i in range(n):
  s = input().split(" ")
  l.append((float(s[0]), s[1]))

r = 0
for val in l:
  r += val[0] if val[1] == "JPY" else val[0] * 380000
print(r)

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

Solution (Python):
N = int(input())
Yen = 0
Bit = 0

for i in range(N):
    x,u = input().split()
    x1 = float(x) 
    if u =="JPY":
        Yen += x1
    elif u == "BTC":
        Bit += x1

Yen +=Bit*380000

print(Yen)

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

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

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

main()

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

res = 0
for i in range(n):
    x, u = float(xu[i][0]), xu[i][1]
    if u == "JPY":
        res += x * 1
    else:
        res += x * 380000

print(res)

Solution (Python):
n = int(input())
y = 0.0
b = 0.0
for i in range(n):
    x, u = map(str, input().split())
    if u == "JPY":
        y += float(x)
    else:
        b += float(x)
print("{:.10f}".format(y + b * 380000.0))

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 += float(xu[0])*380000.0
print(Sum)

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

    
print(sum)

Solution (Python):
N=int(input())
Num = []
Alp = []
for i in range(N):
    n, a = input().split()
    Num.append(float(n))
    Alp.append(a)


ans=jp=bt = 0
for i in range(N):
  if Alp[i]=='JPY':
    jp += Num[i]
  if Alp[i]=='BTC':
    bt += Num[i]*380000.0
ans = jp + bt
print(ans)

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

Solution (Python):


import os
from sys import stdin, stdout

if(os.getenv('__LOCAL__')):
    __dirname = os.path.dirname(__file__)
    __basename = os.path.splitext(os.path.basename(__file__))[0]
    __inputname = './input/' + __basename + '.txt'
    __outputname = './output/' + __basename + '.txt'
    __input_path = os.path.join(__dirname, __inputname)
    __output_path = os.path.join(__dirname, __outputname)
    stdin = open(__input_path)
    

def main():
    N = int(stdin.readline().rstrip())
    ans=0
    for _ in range(N):
        x, v = stdin.readline().rstrip().split(' ')
        x = float(x)
        if(v=="JPY"):
            ans+=x
        else:
            ans+=x*380000
    stdout.write("{}\n".format(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 += float(x)
  else:
    sum += float(x)*380000
print(sum)

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

Solution (Python):
N = int(input())
ans = 0
for _ 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
y = [0]*n

for i in range(n):
    x[i], y[i] = map(str, input().split())
ans = 0
for i in range(n):
    if y[i] == "JPY":
        ans += float(x[i])
    else:
        ans += float(x[i])*380000

print(ans)

Solution (Python):
N = int(input())
m = [None]*N
for i in range(N):
    x,c = (input().split())
    if c == "JPY":
        m[i] = float(x)
    else:
        m[i] = float(x)*380000
print(sum(m))

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

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

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

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

print(ans)

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

answer=0

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

print(answer)

Solution (Python):
N=int(input())
mo=[]
for _ in range(N):
    x,u=input().split()
    x=float(x)
    mo.append([x,u])
okz=0
for i in mo:
    if i[1]=="JPY":
        okz +=i[0]
    else:
        okz += i[0]*380000

print(okz)

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

print(sum)

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

Solution (Python):
import sys
input = sys.stdin.readline
INF = 10**9
MOD = 10**9 + 7

def main():
    n = int(input())
    
    ans = 0
    for _ in range(n):
        x,u = map(str,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 = [input().split() for _ in range(n)]  

ans = sum([float(x)*380000.0 if u == "BTC" else float(x) for x, u in a])
print(ans)

Solution (Python):
def main():
    n = int(input())
    xus = [input() for _ in range(n)]
    ans = 0
    for xu in xus:
        x, u = xu.split()
        if u == "JPY":
            ans += float(x)
        if u == "BTC":
            ans += float(x) * 380000.0

    print(ans)


if __name__ == "__main__":
    main()

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

sm = 0
for x, u in a:
    if u == "JPY":
        sm += float(x)
    else:
        sm += float(x)*380000.0
print(sm)

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 _ 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 _ in range(N):
    x,u = map(str,input().split())
    if u == "JPY":
        ans += int(x)
    else:
        ans += float(x) * 380000.0

print(ans)

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

ans = 0
for x, u in Gifts:
    if u == 'JPY':
        ans += int(x)
    else:
        ans += 380000 * float(x)
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
    elif u=='BTC':
        ans+=x*380000.0

print(ans)

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

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=map(str,input().split())
    x=float(x)
    if u=="BTC":
        x=380000.0*x
    ans+=x
print('{:.7f}'.format(ans))

Solution (Python):




'''a,b= map(int,input().split())'''




a=int(input())
ans=0
x=[list(map(str,input().split())) for _ in range(a)]
for i in range(a):
  if x[i][1]=='BTC':
    ans+=float(x[i][0])*380000
  else:
    ans+=int(x[i][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)*380000.0
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
    else:
        ans += int(x)
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
    else:
        ans += int(x)
print(ans)

Solution (Python):

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

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

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

Solution (Python):
N = int(input())
ans = 0.0
for _ in range(N):
  x_str, unit = map(str, input().split())
  if unit == 'JPY':
    ans += int(x_str)
  else:
    ans += float(x_str) * 380000
print(ans)