Problem:
 Score : 200 points    Problem Statement Takahashi received otoshidama (New Year's money gifts) from N of his relatives.  You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC , and x_i and u_i represent the content of the otoshidama from the i -th relative.  For example, if x_1 =  10000 and u_1 =  JPY , the otoshidama from the first relative is 10000 Japanese yen; if x_2 =  0.10000000 and u_2 =  BTC , the otoshidama from the second relative is 0.1 bitcoins.  If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?      Constraints  2 \leq N \leq 10  u_i =  JPY or BTC .  If u_i =  JPY , x_i is an integer such that 1 \leq x_i \leq 10^8 .  If u_i =  BTC , x_i is a decimal with 8 decimal digits, such that 0.00000001 \leq x_i \leq 100.00000000 .         Input Input is given from Standard Input in the following format:  N  x_1  u_1  x_2  u_2  :  x_N  u_N       Output If the gifts are worth Y yen in total, print the value Y (not necessarily an integer).  Output will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5} .        Sample Input 1 2
10000 JPY
0.10000000 BTC      Sample Output 1 48000.0  The otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.  Outputs such as 48000 and 48000.1 will also be judged correct.       Sample Input 2 3
100000000 JPY
100.00000000 BTC
0.00000001 BTC      Sample Output 2 138000000.0038  In this case, outputs such as 138001000 and 1.38e8 will also be judged correct.

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

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

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

print(ans)

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

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

print(total)

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

money = 0

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

Solution (Python):

N = int(input())
X = []
U = []
for i in range(N):
    x_,u_ = input().split(" ")
    X.append(float(x_))
    U.append(u_)

Y = 0

for i in range(N):
    if U[i] == "JPY":
        Y += X[i]
    else:
        Y += X[i] * 380000.0
        
print(Y)

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

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

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

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

Solution (Python):
n=int(input())
money=[]
for i in range(n):
  x,u=input().split()
  if u=='JPY':
    money.append(int(x))
  elif u=='BTC':
    money.append(float(x)*380000.0)
print(sum(money))

Solution (Python):
N = int(input())
res = 0
while N > 0:
  x,u = input().split()
  res += float(x) if u == 'JPY' else float(x)*380000
  
  N -= 1
print(res)

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

yen = 0

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

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

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

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

total = 0

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

print(total)

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

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
  money, kind = [ v for v in input().split() ]
  money = float(money)
  if kind == "BTC":
    money = money*380000.0
  ans += money
print(ans)

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

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

for i in range(n):
  if x[i][1] == "BTC":
    sum += float(x[i][0])*380000
  else:
    sum += float(x[i][0])
    
print(sum)

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

    else:
        ans += x * 380000

print(ans)

Solution (Python):
N=int(input())
l=[]
for i in range(N):
  d,t=input().split()
  l.append([d,t])
m=0
for i in l:
  if i[1] == "JPY":
    m=m+int(i[0])
  else:
    m=m+380000.0*float(i[0])
print(m)

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):
N=int(input())
num=380000.0
x=0
for i in range(N):
    a,b=input().split()
    if b=='JPY':
        x+=float(a)
    elif b=='BTC':
        x+=float(a)*num
print(x)

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

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

btcjpy = 380000.0
ans = 0

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

print(ans)

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

Solution (Python):
N = int(input())
xu = [[] for _ in range(N)]
for i in range(N):
    xu[i] = list(input().split())
    xu[i][0] = float(xu[i][0])
for i in xu:
    if i[1] == 'BTC':
        i[0] = i[0]*380000.0
print(sum(x[0] for x in xu))

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

N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i] = input().split()
    if u[i] == 'JPY':
        x[i] = int(x[i])
    elif u[i] == 'BTC':
        x[i] = float(x[i])*380000
print(sum(x))

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

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

print(ans)

Solution (Python):


N=int(input())
total=0

for i in range(N):
  a,u=map(str,input().split())
  if u=="JPY":
    total=total+float(a)
  else:
    total=total+float(a)*380000

print(total)

Solution (Python):
N = int(input())
list = []
for i in range(N):
    a, b = input().split()
    list.append(float(a) if b == "JPY" else float(a) * 380000)
print(sum(list))

Solution (Python):
N = int(input())
list = []
for i in range(N):
    a, b = input().split()
    list.append(float(a) if b == "JPY" else float(a) * 380000)

print(sum(list))

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

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

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

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())
money = []
unit = []
for i in range(n):
    m, u = input().split()
    money.append(float(m))
    unit.append(u)

total = 0.0
for m, u in zip(money, unit):
    if u == 'JPY':
        total += m
    else:
        total += 380000.0*m
print(total)

Solution (Python):
s=0
for _ in range(int(input())):
	a, b=input().split()
	if b=='BTC':
		a=float(a)*380000
	s+=float(a)
print(s)

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

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

input = [input() for i in range(number)]

result = 0

for i in range(number):
	otoshidama = input[i].split()
	if otoshidama[1] == "JPY":
		result = result + float(otoshidama[0])
	elif otoshidama[1] == "BTC":
		result = result + float(otoshidama[0]) * 380000.0

print(result)

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

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

money = float(0)

for i in range(N):
    if x[i][1] == 'BTC':
        money += float(x[i][0]) * 380000
    else:
        money += float(x[i][0])

print(money)

Solution (Python):


def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

    for i in range(0, N):
        if lst[i][1] == "JPY":
            Y += float(lst[i][0])
        else:
            Y += float(lst[i][0])*380000.0
    print(Y)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

    for i in range(0, N):
        if str(lst[i][1]) == "JPY":
            Y += float(lst[i][0])
        else:
            Y += float(lst[i][0])*380000.0
    print(Y)


if __name__ == "__main__":
    main()

Solution (Python):

N = int(input())
lst_1 = []
ans = 0

for n in range(N):
    lst_1.append(input().split())

for n in range(N):
    money = 0
    money = float(lst_1[n][0])
    if lst_1[n][1] == "BTC":
        money = money * 380000
    ans += money

print(ans)

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

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

print(sum)

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

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

print(total)

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

Solution (Python):
N=int(input())
x=[list(input().split()) for _ in range(N)]
ans = 0
for  value, many_type in x:
	if many_type == 'JPY':
		ans += float(value)
	else:
		ans += float(value)*380000

print(ans)

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

Solution (Python):
N = int(input())
xus = []
for _ in range(N):
    xus.append([e for e in input().split(" ")])

cum = 0.0
for x, u in xus:
    x = float(x)
    if u == "JPY":
        cum = cum + x
    else:
        cum = cum + 380000.0 * x
print(cum)

Solution (Python):
ans=0
n=int(input())
for i 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):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



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


def main():
    N = int(input())

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

    print(ans)


if __name__ == '__main__':
    main()

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

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

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

sum=0

for i in range(n):
  a,b=map(str, input().split())
  A=float(a)
  if b=="BTC":
    k=A*380000
  else:
    k=A
  sum+=k
print(float(sum))

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

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

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

for i in range(n):
    if xu[i][1]=='BTC':
        xu[i][0]=float(xu[i][0])* 380000.0
    else:
        xu[i][0]=float(xu[i][0])

print(sum(x[0] for x in xu))

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

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

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

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

if __name__ == '__main__':
    main()

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

ans=0

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

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

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

    if u == 'JPY':
        total += int(x)
    else:
        total += float(x) * 38e4

print(total)

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

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

print(A)

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

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

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

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

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

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

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

Solution (Python):
N = int(input())
x = [0]*N
u = [0]*N
for n in range(N):
    a = list(input().split())
    x[n] = float(a[0])
    u[n] = a[1]
S = 0
    
for n in range(N):
    if u[n] == 'JPY':
        S += x[n]
    elif u[n] == 'BTC':
        S += x[n] * 380000.

print(S)

Solution (Python):
N = int(input())
x = 0
u = 0
Y = 0
for i in range(N):
    str = input().split(' ')

    x = float(str[0])
    u = str[1]
    if u == 'JPY':
        Y += x
    else:
        Y += x * 380000.0
print(Y)

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

x = []
u = []

for i in range(n):
    tmpx, tmpu = input().split()
    x.append(float(tmpx))
    u.append(tmpu)

ans = 0.0
for i in range(n):
    if u[i] == "JPY":
        ans += float(x[i])
    else:
        ans += float(x[i]) * 380000.0

print(ans)

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

Solution (Python):
from sys import stdin
from decimal import *
N = int(stdin.readline().rstrip())
sp = [stdin.readline().split() for i in range(N)]

sum = Decimal(0)
bitcoin = Decimal(380000.0)
for i in range(N):
    sp[i][0] = Decimal(sp[i][0])
    
    if sp[i][1] == 'JPY':
        sum += sp[i][0]
    else:
        sum += sp[i][0] * bitcoin
print(sum)

Solution (Python):

import sys


def solve(N: int, X: "List[float]", U: "List[str]"):
    money = 0

    for x,u in zip(X,U):
        xx = x
        if u == "BTC":
            xx = x*380000.0

        money += xx
    
    print(money)




def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    x = [float()] * (N)  
    u = [str()] * (N)  
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    solve(N, x, u)

if __name__ == '__main__':
    main()

Solution (Python):
import math
n = int(input())
total = float(0)
for i in range(n):
    val, t = input().split()
    val = float(val)
    if t == "JPY":
        total += val
    else:
        total += (val * 380000)

print(total)

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

Solution (Python):
N=int(input())
i=0
j=0
L=[]
cnt=0
while i<N:
     l=list(input().split())
     L.append(l)
     i+=1
while j<N:
     if L[j][1]=="JPY":
          cnt+=int(L[j][0])
     else:
          cnt+=float(L[j][0])*380000.0
     j+=1
print(cnt)

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

btc = 0
yen = 0

for i in range(a):
    a = input().split()
    if a[1] == 'BTC':
        btc += float(a[0])
    else:
        yen += int(a[0])

btc = btc * 380000

print(float(btc + yen))

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

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

sum_charge = 0
for i in range(N):
    x,v = input().split()
    x = float(x)

    if v == 'JPY':
        sum_charge += x
    else:
        sum_charge += (x*380000.0)

print('{:.11f}'.format(sum_charge))

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

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

print(amnt)

Solution (Python):
import sys


def input():
    return sys.stdin.readline()[:-1]









N = int(input())

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

print(sum)

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

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

    if u == "JPY":
        sum = sum + int(x)
    elif u == "BTC":
        bit = 380000 * (float(x) / 1.0)
        sum = sum + bit

print(sum)

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

Solution (Python):
n = int(input())
xu = [list(input().split()) for _ in range(n)]
btc = 380000.0
ans = float(0)

for i in range(n):
    count = 0
    if xu[i][1] == 'JPY':
        ans += int(xu[i][0])
    else:
        ans += btc * float(xu[i][0])

print('{:.7f}'.format(ans))

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

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

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

print(sum)

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

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

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

res = 0

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

print(res)

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

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

Solution (Python):
JPY = "JPY"
RATE = 380000
N = int(input())
my_list = []
for i in range(N):
    s = input()
    my_list.append((float(s.split()[0]), s.split()[1]))



ret = 0
for i in range(len(my_list)):
    if my_list[i][1] == JPY:
        ret += my_list[i][0]
    else:
        ret += my_list[i][0] * RATE
print(ret)

Solution (Python):
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

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

print(ans)

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




money = {'JPY': 1, 'BTC': 380000}

yen = 0
for row in e:
    yen += float(row[0]) * money[row[1]]

print(yen)

Solution (Python):

"""
Created on Mon May 13 21:41:22 2019

@author: avina
"""


d = 380000.0 
sums = 0
n = int(input())
for i in range(n):
  a,b = input().strip().split()
  if b == 'JPY':
    sums += float(a)
  else:
    sums += d*float(a)
print(sums)

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

jpy = 0.0
btc = 0.0
rating = 380000.0
sum = 0.0

for i in range(0, N):
    if otoshidama[i][1] == "JPY":
        jpy += float(otoshidama[i][0])
    else:
        btc += float(otoshidama[i][0])

sum = jpy + btc * rating

print(sum)

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

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

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

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

N = int(input())
L = [input().strip().split() for _ in range(N)]

s = 0
for v in L:
    if v[1] == "JPY":
        s += int(v[0])
    else:
        s += float(v[0]) * 380000
        
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 += 380000*x
print(ans)

Solution (Python):
n = int(input())
money = []
tuka = []
for i in range(n):
    li = input().split()
    money.append(float(li[0]))
    tuka.append(li[1])

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

Solution (Python):
N = int(input())
a, b = [], []
for i in range(N):
    s, t = input().split()
    s = float(s)
    a.append(s)
    b.append(t)

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

Solution (Python):
from sys import stdin


def main():
    N = int(stdin.readline().rstrip())
    xus = [stdin.readline().rstrip().split() for _ in range(N)]
    xs = [int(x) if u == 'JPY' else float(x) * 380000 for x, u in xus]
    print(sum(xs))


if __name__ == "__main__":
    main()

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

Solution (Python):


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

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

Solution (Python):
N = int(input())
x=[]
u=[]
for i in range(0,N):
    a=[j for j in input().split()]
    x.append(float(a[0]))
    u.append(a[1])

s=0
for i in range(0,N):
    if u[i]=="BTC":
        s+=380000*x[i]
    else:
        s+=x[i]
print(s)

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

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

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

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

Solution (Python):
n = int(input())
y_l = []
b_l = []
for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        y_l.append(float(x))
    else:
        b_l.append(float(x))

total = sum(y_l) + (sum(b_l) * 380000)
print(total)

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

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

print(sum_otoshidama_jpy)

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

Solution (Python):
n=int(input())
x=[input().split() for _ in range(n)]
print(sum([float(x[i][0])*[1,380000][x[i][1]=="BTC"] for i in range(n)]))

Solution (Python):
N = int(input())
dama = 0.0
for i in range(N):
    x,u = input().split()
    if (u == "BTC") :
        dama += float(x) * 380000.0
    else :
        dama += float(x)

print(dama)

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

Solution (Python):
N = int(input())
def money(A):
    if A[1]=="JPY":
      return float(A[0])
    else:
      return float(A[0])*380000.0
A = [money(input().split()) for _ in range(N)]
print(sum(A))

Solution (Python):
import math
from decimal import *
n = int(input())

total = Decimal('0')

for i in range(n):
  x, u = map(str, input().split())
  if u == 'BTC':
    x = Decimal(Decimal(x)) * Decimal(380000.0)
  total += Decimal(x)

print(round(total, 4))

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

Solution (Python):
N = int(input())
S=[]
for i in range(N):
    A=list(input().split())
    
    if A[1]=="JPY":
        S.append(int(A[0]))
    elif A[1]=="BTC":
        S.append(float(A[0])*380000)
print(sum(S))

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

print(y)

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

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

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

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

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