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

s = 0    
for j in range(n):
    if u[j] == 'JPY':
        s += x[j]
    else:
        s += x[j] * 380000
print(s)

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

Solution (Python):
n = int(input())
x = [0] * n
u = ['.'] * n


for i in range(n):
    tmp = input().split()
    x[i], u[i] = float(tmp[0]), str(tmp[1])


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

print(total)

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

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

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

s = 0
for i in range(n):
    if listu[i] == "JPY":
        s += listx[i]
    else:
        s += listx[i] * 380000

print(s)

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

Solution (Python):
N = int(input())
XL = []
for i in range(N):
    X,U = list(input().split())
    X = float(X)
    if U=="BTC":
        X = X*380000
    XL.append(X)

print(sum(XL))

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

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

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

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

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):
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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

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

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

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

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

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

xu = [[str(i) for i in input().split()] for _ in range(n)]

ans = 0

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

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

for i in range(N):
    value, kahei = input().split()
    value=float(value)
    
    if (kahei == 'BTC'):
        value *= 380000
    
    total += value

print(total)

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

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

print(count)

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

money = []

for i in range(n):
  x,u = input().split()
  x = float(x)
  if u == "BTC":
    x *= 380000.0
  money.append(x)

print(sum(money))

Solution (Python):


N = int(input().strip())
x_u = [[j for j in input().split()] for i in range(N)]

amou=float(0)
for x_str,u in x_u:
    if u == "JPY":
        amou += float(x_str)
    else:
        amou += float(x_str) * 380000

print(amou)

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

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

ans = 0

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

Solution (Python):
N = int(input())
a = [list(map(str, input().split())) for i in range(N)]
a = list(map(list, zip(*a)))
ans = 0
for i, v in enumerate(a[1]):
    if v == "JPY":
        ans += int(a[0][i])
    else:
        ans += float(a[0][i]) * 380000

print(ans)

Solution (Python):
N = int(input())
q = [None] * N
t = [None] * N
ans = 0
for i in range(N):
    q[i], t[i] = input().split()

for i, v in enumerate(t):
    if v == "JPY":
        ans += int(q[i])
    else:
        ans += float(q[i]) * 380000

print(ans)

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

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

d = {"JPY":0,"BTC":0}

for i in range(n):
    x, u = map(str,input().split())
    d[u] += float(x)
    continue

ans = d["JPY"] + d["BTC"]*380000

print(ans)

Solution (Python):
N = int(input())
list_x = []
list_u = []
for i in range(N) :
    x, u = input().split()
    list_x.append(x)
    list_u.append(u)

ans = 0
for i in range(N) :
    if list_u[i] == "JPY" :
        ans += int(list_x[i])
    else :
        ans += float(list_x[i]) * 380000.0

print(ans)

Solution (Python):
n=int(input())
ans = 0
for _ 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())
x = [input().split() for i in range(n)]
ans = 0

for i in x:
    if i[1] == "BTC":
        ans += float(i[0]) * 380000
    else:
        ans += float(i[0])
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+=380000*float(X)
print(money)

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

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

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

mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

N = ni()
ans = 0
for _ in range(N):
    x, u = ns().split()
    if u =="JPY":
        ans += int(x)
    else:
        ans += float(x)*380000
print("{:.6f}".format(ans))

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

print(ans)

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

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

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

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

    count=0
    for i in range(N):
        if U[i]=="JPY":
            count+=X[i]
        else:
            count+=380000*X[i]
    print(count)
if __name__=="__main__":
    main()

Solution (Python):
N=int(input())
ans=0
for i in range (N):
	A,B=input().split()
	if B=="JPY":
		ans+=float(A)
	elif B=="BTC":
		ans+=float(A)*380000.0
print(ans)

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

print(ans)

Solution (Python):

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

ans = 0
for i in range(n):
    if xu[i][1] == "JPY":
        ans += int(xu[i][0])
    elif xu[i][1] == "BTC":
        ans += float(xu[i][0]) * 380000
print(ans)

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

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

ans = 0
for x,u in XU:
    f = float(x)
    if u=='BTC':
        f *= 380000
    ans += f
print(ans)

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())
o = 0
for i in range(n):
    xu = input().split()
    if xu[1]=='BTC':
        o += float(xu[0])*380000
    else:
        o += float(xu[0])
print(o)

Solution (Python):

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

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

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

print(ans)

Solution (Python):
N=int(input())
X=[]
U=[]
ans=0
for i in range(N):
	A,B=input().split()
	X.append(float(A))
	U.append(B)
for i in range(N):
	if U[i]=="JPY":
		ans+=X[i]
	elif U[i]=="BTC":
		ans+=(X[i]*380000.0)
print(ans)

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

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

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

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

ans = jpy + 380000 * btc
print(ans)

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

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

Solution (Python):
T=[]
N=int(input())
for i in range(N):
  x,u=map(str,input().split())
  if u=="BTC":
    T.append(float(x)*380000)
  else:
    T.append(float(x))
print(sum(T))

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

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

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

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

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

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

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

print(ans)

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

print(ans)

Solution (Python):
rate = 380000.0

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

ans = 0
for i in xu:
    x, u = float(i[0]), i[1]
    if u == 'BTC':
        ans += x * rate
    else:
        ans += x

print(ans)

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

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

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

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

Solution (Python):




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


if __name__ == "__main__":
    main()

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

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

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())
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())
lst = []
for _ in range(n):
    x,y = [x for x in input().split()]
    lst.append([float(x),y])

money = 0

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

print(money)

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

Solution (Python):
n=int(input())
c=0.0
list = []
for i in range(n):
    a,b=input().split()
    list.append((float(a), b))

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

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

print(sum)

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

print(s)

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):
def input_int():
    return map(int, input().split())

def input_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=input_int()



dicts={}
dicts["JPY"]=0
dicts["BTC"]=0

for i in range(N):
    x, u = input().split()
    dicts[u] += float(x)

sums = dicts["JPY"] + dicts["BTC"] * 380000.0

print(sums)

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

Solution (Python):
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
nf = lambda: float(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n = ni()
x, u = [], []
for i in range(n):
    s = nas()
    a, b = float(s[0]), s[1].rstrip()
    x.append(a)
    u.append(b)

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

print(ans)

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 += float(x)

print(ans)

Solution (Python):
n = int(input())
datax = []
datau = []
lst = []
for i in range(n):
    x,u = input().split()
    x = float(x)
    datax.append(x)
    datau.append(u)
for j in range(n):
    if datau[j] == "JPY":
        lst.append(datax[j])
    if datau[j] == "BTC":
        lst.append(datax[j]*380000.0)
print(sum(lst))

Solution (Python):
N = int(input())
x, u = [0]*N, ['0']*N
for i in range(N):
    tmp_x, tmp_u = map(str, input().split())
    x[i], u[i] = float(tmp_x), tmp_u
cor = zip(x,u)

answer = 0
for i,j in cor:
    if j == 'JPY':
        answer += i
    else:
        answer += i*380000.0
print(answer)

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

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

    if(u == "JPY"):
        sum_m += int(x)
    else:
        sum_m += float(x) * 380000
print(sum_m)

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

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

ans = 0
for _ in range(N):
    Ns = input().split()
    money = float(Ns[0])
    if Ns[1] == 'BTC':
        btc = money * 380000.0
        ans += btc
    else:
        ans += money

print(ans)

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

Solution (Python):
N = int(input())
cnt = 0
for i in range(N):
    x,u = input().split()
    x = float(x)

    if u == 'JPY':
        cnt += x
    else:
        cnt += x * 380000.0
print(cnt)

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

sum = 0

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

print(sum)

Solution (Python):
n = int(input())
x = []
ans = 0
for i in range(n):
  array = list(map(str,input().split()))
  x.append(array)
  if x[i][1] == "JPY":
  	ans += int(x[i][0])
  else:
  	ans += float(x[i][0]) * 380000
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):
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

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

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

jpy = 0
btc = 0

for i in range(n):
  s = input().split()
  a = float(s[0])
  b = s[1]
  if b == 'JPY':
    jpy += a
  elif b == 'BTC':
    btc += a

btc = btc * 380000
print(jpy + btc)

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

Solution (Python):

n=int(input())
x=[]
u=[]
btc=380000
ans=0
def yen_or_btc(m):
    if m=="JPY":
        return 1
    else:
        return btc

for i in range(n):
    y,b=list(input().split())
    y=float(y)
    x.append(y)
    u.append(b)

for i in range(n):
    ans+=x[i]*yen_or_btc(u[i])
print(ans)

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

for x, u in xu:
	
	if u == "BTC":
		ans += float(x) * 380000.0
	else:
		ans += int(x)

print(ans)

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

Solution (Python):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
S_MAP = lambda: map(str, INPUT().split())

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()

    ans = 0
    for i in range(N):
        X, U = S_MAP()
        ans += int(X) if U == "JPY" else float(X) * 380000

    print(ans)


if __name__ == '__main__':
    main()

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

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())
x=[input().split() for _ in range(N)]
count=0

for i in range(N):
    x[i][0]=float(x[i][0])

for i in range(N):
    if x[i][1]=="BTC":
        count=count+380000.0*x[i][0]
    else:
        count = count + x[i][0]
print(count)

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())
xu = []
for _ in range(n):
    x, u = map(str, input().split())
    xu.append((float(x), u))

ans = 0
for i in xu:
    if i[1] == "JPY":
        ans += i[0]
    else:
        ans += i[0] * 380000

print(ans)

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

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

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

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

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

Solution (Python):
import sys
import math
import itertools

n=input()
sum=0

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

print(sum)

Solution (Python):
N=int(input())
jp="JPY"

ans=0.0
for i in range(N):
    y,u=input().split()
    x=float(y)
    d=380000.0
    if u==jp:
        d=1
    ans+=x*d
    
print(ans)

Solution (Python):
def main(n, x_u):
    ans = 0
    btc = 380000.0

    for x, u in x_u:
        if u == 'JPY':
            ans += int(x)
        else:
            ans += float(x) * btc

    print(ans)


if __name__ == "__main__":
    n = int(input())
    x_u = [input().split() for _ in range(n)]

    main(n, x_u)

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

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

Solution (Python):
N = int(input())
U = {'JPY': 1.0, 'BTC': 380000.0}
ans = 0.0
for i in range(N):
    x, u = input().split()
    ans += float(x) * U[u]
print(ans)

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

total_JPY = 0
for j in range(n):
    if l[j][1] == 'JPY':
        total_JPY += int(l[j][0])
    else:
        total_JPY += float(l[j][0])*380000
print(total_JPY)

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

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()
    x =float(x)
    ans += x if u == 'JPY' else 380000*x
print(ans)

Solution (Python):
Row = int(input())
money = []
k=[]
num = 0
for _ in range(Row):
    a,b = map(str,input().split())
    money.append(float(a))
    k.append(b)
for i in range(Row):
    if k[i]=="JPY":
        num+=money[i]
    else:
        num=num+380000.0*money[i]
print(num)

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


otoshidama = [float(i[0]) if i[1] == "JPY" else float(i[0])*380000 for j in range(n) for i in [input().split()]]
print(sum(otoshidama))

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


if __name__ == '__main__':
    main()

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

for x, u in otoshidama:
    if u == 'JPY':
        ans += float(x)
    else:
        ans += float(x) * 380000

print(ans)

Solution (Python):
n = int(input())
y = 0
b = 0
r = 380000.0

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

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

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):
"""
author : halo2halo
date : 16, Jan, 2020
"""

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
ans = 0

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

print(ans)

Solution (Python):
N = int(input())
ans = 0.0
for _ in range(N):
  amount, kind = input().split()
  if kind == "JPY":
    ans += float(amount)
  elif kind == "BTC":
    ans += float(amount) * 380000.0
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 += x
    else:
        ans += x*(380000)

print(ans)