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):
sum_gift = 0
Gift_lists = []
N = int(input())
for i in range(0, N):
    Gift_lists.append([x.strip() for x in input().split()])

for l in Gift_lists:
    if l[1]=='JPY':
        sum_gift += int(l[0])
    else:
        sum_gift += float(l[0])*380000.0
print(sum_gift)

Solution (Python):
number = int(input())
price = []
for i in range(number):
	price.append(input().split(" "))
jpy = 0
btc = 0
for i,j in price:
	if j == "JPY":
		jpy += float(i)
	else:
		btc += float(i)
print(jpy + btc*380000)

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

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

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

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

print(total)

Solution (Python):
N = int(input())
gift = []

for i in range(N):
    gift.append((input().split()))

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

print(sum)

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

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

print(ans)

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

tot=0.0
for i in range (n):
	ip=input()
	ip=ip.split()
	x.append(float(ip[0]))
	w.append(ip[1])

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

print(tot)

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

Solution (Python):



N = int(input())
A = []
sum = 0

for i in range(N) : 
    a, b = input().split()
    A.append((a, b))
    
for i in range(N) : 
    if A[i][1] == "JPY" : sum += float(A[i][0])
    else : sum += float(A[i][0])*380000.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()) 
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())
total = 0
for i in range(n):
    inp = input().split()
    x, u = float(inp[0]), inp[1]
    if u=='JPY':
        total += x
    else:
        total += 380000.0*x
        
print(total)

Solution (Python):

N = int(input())
x, u = zip(*((float(t[0]), t[1]) for t in (input().split() for _ in range(N))))


ans = sum(
    t[0] if t[1] == 'JPY' else
    380000 * t[0] for t in zip(x, u)
)


print(ans)

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

for i in range(N):
    if x_u[i][1] == "JPY":
        otoshidama.append(eval(x_u[i][0]))
    else:
        otoshidama.append(eval(x_u[i][0])*380000.0)
        
print(sum(otoshidama))

Solution (Python):

N = int(input().strip())

sum = 0
for n in range(N):
	S = input().strip().split()
	xn = float(S[0])
	un = S[1]
	if un == 'JPY':
		sum += xn
	elif un == 'BTC':
		sum += 380000*xn

print(sum)

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

Solution (Python):


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

Solution (Python):
N=int(input())
a=[]
b=[]
for i in range(N):
  x,y=input().split()
  a.append(float(x))
  b.append(y)
total=0
for j in range(N):
  if b[j]=='JPY':
    total += a[j]
  else:
    total += 380000.0*a[j]
print(total)

Solution (Python):
N = int(input())
rs = []
jys = []
for _ in range(N):
    r,jy=input().split()
    rs.append(float(r))
    jys.append(jy)
sum_r = 0
for i in range(len(rs)):
    if jys[i] == 'JPY':
        sum_r += rs[i]
    else:
        sum_r += 380000 * rs[i]
print(sum_r)

Solution (Python):
N=input()

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

print(sum)

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

X=[]
for i in range(N):
    x,u = input().split() 
    if u=="JPY":
        x=float(x)
    else:
        x=float(x)
        x=x*380000
    
    X.append(x)

print(sum(X))

Solution (Python):

n = int(input())

all = 0.0
for i in range(n):
    g, t = input().split()
    if t == 'JPY':
        all += int(g)
    else:
        all += float(g) * 380000.0
print (all)

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

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

Solution (Python):
n = int(input())
res = 0
for i in range(n) :
  value, unit = input().split()
  if(str(unit) == 'BTC') : res += float(value) * 380000
  else : res += float(value)
print(res)

Solution (Python):
n = int(input())
otosidama = float(0)

for i in range(n):
    x,y = map(str,input().split())
    x = float(x)
    if y == "JPY" :
        otosidama = otosidama + x
    else:
        otosidama = otosidama + x * 380000.0

print(otosidama)

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])
    elif i[1] == 'BTC':
        Y += (380000.0 * float(i[0]))

print(Y)

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

for i in range(0,N):
  A,B=(input().split(" "))
  AA=float(A)
  if B=="BTC":
    AA=AA*380000
  
  OTOSHIDAMA+=AA
  
  
print(OTOSHIDAMA)

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

Solution (Python):
RATE = 380000.0;
N = int(input());

sum = 0;
for i in range(N):
    s = input().split(" ");
    if s[1] == "BTC":
        sum = sum + float(s[0])*RATE;
    else:
        sum = sum + float(s[0]);

print(sum)

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

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

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

m = 0

g = []

for i in range(n):
    g.append(list(input().split()))

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

print(m)

Solution (Python):
N = int(input())
JPY,BTC = [],[]
for i in range(N):
    X,Y = input().split()
    if Y == 'JPY':
        JPY.append(float(X))
    else:
        BTC.append(float(X))
ans = sum(JPY) + sum(BTC) * 380000
print(ans)

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

dama = 0
for i in range(line):
    data = input().split()
    if data[1] == "JPY":
        dama += int(data[0])
    else:
        dama += float(data[0]) * 380000
print(dama)

Solution (Python):

import sys


def solve(N: int, x: "List[float]", u: "List[str]"):
    ret = 0

    for xi, ui in zip(x, u):
        if ui == "JPY":
            ret += xi
        else:
            ret += 380000.0 * xi
    print(ret)



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):
N = int(input())
d = {"JPY":0, "BTC":0}
for i in range(N):
    x,u = map(str,input().split())
    d[u] += float(x)
print(d["JPY"]+d["BTC"]*380000)

Solution (Python):
d = {"JPY":1, "BTC":380000}
s = 0
for _ in [0]*int(input()):
  x,u = input().split()
  s += float(x)*d[u]
print(s)

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

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

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

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

answer = 0
for i in range(N):
    x_cand, u_cand = input().split()

    x_cand = float(x_cand)
    u_cand = str(u_cand)

    if u_cand == "JPY":
        answer += x_cand
    elif u_cand == "BTC":
        answer += x_cand * 380000.0

print(answer)

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

print(ans)

Solution (Python):
N = int(input())
a = []

for i in range(N):
  x,y = input().split()
  a.append([x,y])

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

print(ans)

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

sum = 0
for i in range(len(a)):
    currency = a[i][1]
    if currency == 'JPY':
        sum += int(a[i][0])
    else:
        sum += float(a[i][0]) * 380000.0
print(sum)

Solution (Python):










n=int(input())
total=0.0
i=n
while i>0:
	x,u=map(str,input().split())
	x=float(x)
	if u=="JPY":
		total+=x
	elif u=="BTC":
		total+=x*380000.0
	i-=1

print(total)

Solution (Python):

n = int(input())
kanezuru = []
summoney = 0
for i in range(n):
    x, u = input().split()
    kanezuru.append([float(x), u])

for i in range(n):
    if kanezuru[i][1] == 'BTC':
        kanezuru[i][0] *= 380000.0
    summoney+= kanezuru[i][0]

print(summoney)

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

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

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

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

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

n = ni()
ans = 0
for i in range(n):
  a,c = nn()
  r = 1 if c == "JPY" else 380000
  ans += float(a)*r

print(ans)

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

print(sum)

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

Solution (Python):

import sys


def solve(N: int, x: "List[float]", u: "List[str]"):
    ans = 0
    for y, v in zip(x, u):
        if v == "JPY":
            ans += y
        else:
            ans += y*380000
    print(ans)
    return



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

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

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

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

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

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

Solution (Python):
n = int(input())
data = list(map(lambda x:(float(x[0]),x[1]),[input().split() for i in range(n)]))
print(sum([i[0] for i in data if i[1] == 'JPY'])+sum([i[0] for i in data if i[1] == 'BTC'])*380000.0)

Solution (Python):
def jpybtc(s):
    rate = 0
    if s == "JPY": 
        rate = 1.0 
    elif s == "BTC": 
        rate = 380000.0 
    return rate
    
n = int(input())
x = [0]*(n+1)
u = [0]*(n+1)



for i in range(1,n+1):
    x[i], u[i] = input().split()
x = list(map(float,x))
v = list(map(jpybtc,u))


sum = 0
for j in range(1,n+1):
    sum = sum + x[j] * v[j]
print(sum)

Solution (Python):
BTC = 380000.0
sum_money = 0.0

N = int(input())
for _ in range(N):
    amount, which = input().split()
    amount = float(amount)
    if (which=='BTC'):
        amount = amount*BTC
    sum_money += amount

print(sum_money)

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

sum_yen = 0.0

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

    if u == 'JPY':
        sum_yen += int(x)
    else:
        sum_yen += float(x) * 380000.0

print(sum_yen)

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

JP = [0]
BTC = [0]

for _ in range(N):
    L = input().split()
    if L[1] == "JPY":
        JP.append(float(L[0]))
    else:
        BTC.append(float(L[0]))
print(sum(JP) + sum(BTC) * 380000)

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

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

Solution (Python):



N = int(input())

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

Solution (Python):



N = int(input())

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

Solution (Python):



N = int(input())

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

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

Solution (Python):
N = int(input())
X, U = ['' for _ in range(N)], ['' for _ in range(N)]
for n in range(N):
    X[n], U[n] = input().split()

otoshidama = 0
for n in range(N):
    if U[n] == 'JPY':
        otoshidama += float(X[n])
    else:
        otoshidama += float(X[n])*380000.0

print(otoshidama)

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

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

print(sum(x))

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

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

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

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

total = 0
for i in range(0,c):
  k,v = map(str, input().split())
  if(v == "JPY"):
    total += int(k)
  else:
    total += float(k) * 380000 
print(total)

Solution (Python):



NN = int( input() )
total = 0
bitcoin = 380000.0
for ii in range( NN ) :
    money, currency_type = input().split()
    
    if currency_type == "JPY" :
      total += int( money )
    elif currency_type == "BTC" :
      yen = float( money ) * bitcoin
      total += yen
else:
  print( total )

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

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

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

print(ans)

Solution (Python):
N = int(input())
ans = 0.0
for k 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):
    xi, ui = input().split()
    if ui == 'JPY':
        ans += int(xi)
    else:
        ans += float(xi) * 380000
print(ans)

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

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

jp = float(0)
bi = float(0)

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

  if u == "JPY":
    jp += x
  elif u == "BTC":
    bi += x

print(float(jp + (bi*380000.0)))

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

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

relatives = int(input())


BTC = 0.0


JPY = 0


Currency = ''
amount = ''


total = 0.0

for i in range(relatives):
  amount, Currency = map(str,input().split())


  if Currency == 'JPY':
    JPY += int(amount)


  elif Currency == 'BTC':
    BTC += float(amount)


total = JPY + 380000.0 * float(BTC)

print(total)

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

Solution (Python):


if __name__ == "__main__":
    num = int(input())
    money = []
    mtype = []
    for p in range(num):
        m_tmp, mt_tmp = input().split()
        money.append(float(m_tmp))
        mtype.append(mt_tmp)
    
    total = 0
    for m, mt in zip(money, mtype):
        if mt == "JPY":
            total += m
        else:
            total += m * 380000.0
    
    print(total)

Solution (Python):
N = int(input())
x_u = [input().split() for _ in range(N)]
x_u = [(float(i[0]), i[1]) for i in x_u]

result = 0
for x, u in x_u:
    if u == "JPY":
        result += x
    else:
        result += x * 380000.0

print(result)

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

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

result = 0
for x in e:
    if x[1] == "JPY":
        result += float(x[0])
    else:
        result += float(float(x[0])*380000)

print(result)

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


if __name__ == "__main__":
    main()

Solution (Python):

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

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

Solution (Python):
N = int(input())
yen = []
for i in range(N):
    xi, ui = input().split()
    xi = float(xi)
    if ui == "BTC":
        ui = 380000
    else:
        ui = 1
    yen.append(xi*ui)
print(sum(yen))

Solution (Python):
n = int(input())
gifts = [list(input().split()) for _ in range(n)]
gifts = [float(x) if u == 'JPY' else float(x) * 380000.0 for x, u in gifts]
print(sum(gifts))

Solution (Python):
def solve(string):
    n, *xu = string.split()
    return str(sum([int(x) if u == "JPY" else float(x) * 380000 for x, u in zip(xu[::2], xu[1::2])]))


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(n)])))

Solution (Python):
count = int(raw_input())
total = 0.0
for i in range(count):
    otoshidama = raw_input().split(' ')
    if otoshidama[1] == 'JPY':
        total += int(otoshidama[0])
    else:
        total += float(otoshidama[0]) * 380000
print(total)

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

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

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

print(ans)

Solution (Python):
def main():
    n = int(input())
    s = 0

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

    print(s)

main()

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

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

print(cnt)

Solution (Python):

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

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

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

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

Solution (Python):
BTC = 380000.0

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

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

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

print(cnt)

Solution (Python):
N = int(input())
total = 0.0
rate = 380000.0

for i in range(N):
    a,t = input().split()
    a = float(a)
    if (t=="BTC"):
      total += a * rate
    else:
      total += a
print(total)

Solution (Python):
N = int(input())
rateBtcYen =  380000.0 
totalYen = 0
for i in range(0, N):
    amountString, currency = input().split()
    amount = float(amountString)
    if currency == "BTC":
        totalYen += amount*rateBtcYen
    else:
        totalYen += amount
print(totalYen)

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

rate = 380000
sum_lottery = 0

for count in range(number):
    money,type = input().split()

    if (type == "JPY"):
        money = int(money)
        sum_lottery += money
    else:
        money = float(money)
        sum_lottery += money * rate

print(sum_lottery)

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

x = []
u = []
for it in range(N):
    tmpx, tmpu = input().split()
    x.append(eval(tmpx))
    u.append(tmpu)

count = 0
for it in range(N):
	if u[it] == 'JPY':
		count += x[it]
	elif u[it] == 'BTC':
		count += x[it]*380000.0

print(count)

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

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

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

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

money=list(input().split(' ') for _ in range(N))

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

print(sum)

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

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

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

B2Y = 380000.0

otoshidama = 0

for item in money:
    if item[1] == 'JPY':
        otoshidama += float(item[0])
    else:
        otoshidama += float(item[0])*B2Y

print(otoshidama)

Solution (Python):
import sys

z = 0
for line in sys.stdin:
  xs = line.split()
  if len(xs) < 2:
    continue
  if xs[1] == 'BTC':
    z += 380000 * float(xs[0])
  else: 
    z += float(xs[0])
print(z)

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

answer=0
for _ in range(N):
  money_str,unit=input().split()
  money=float(money_str)
  if unit == "BTC":
    money*=380000
  answer += money
  
print(answer)

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

answer=0
for _ in range(N):
    money_str, unit = input().split()
    money = float(money_str)
    if unit == "BTC":
        money *= 380000
    answer += money

print(answer)

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

sumOtoshidama = 0
for _ in range(N):
    amountStr, unit = input().split()
    amount = float(amountStr)
    if unit == "BTC":
        amount *= 380000
    sumOtoshidama += amount

print(sumOtoshidama)

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

Solution (Python):
num = int(input())
sum = 0.0
for i in range(num):
  row = input().split()
  crr = row[1]
  if (crr == "BTC"):
    val = float(row[0])
    val *= 380000.0
  else:
    val = int(row[0])
  sum = sum+val
print(sum)

Solution (Python):
n = int(input())
a = []
a.append([0,0])
for i in range(n):
    in1, in2 = map(str, input().split())
    a.append([float(in1),in2])

ans = 0

for i in range(n):
    j = i + 1
    if a[j][1] == 'BTC':
        ans += a[j][0]*380000
    else :
        ans += a[j][0]
print(ans)

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

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

value = 0
converter = {
    'JPY' : 1,
    'BTC' : 380000
}
for v in vectors:
    x, u = v
    value += float(x) * converter.get(u)

print(value)

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

for i in range(n):
    buf = input().split()
    rate = 1
    if buf[1] == "BTC":
        rate = 380000
    ans += float(buf[0]) * rate

print(ans)

Solution (Python):
N = int(input())
xn, un =[0]*N, [0]*N
for i in range(N):
    xn[i], un[i] = map(str,input().split())

ans = 0
for i in range(N):
    if un[i] == "JPY":
        ans += float(xn[i])
    if un[i] == "BTC":
        ans += float(xn[i])*380000
print(ans)

Solution (Python):
N=int(input())
BTC_to_JPY=380000.0
price_sum=0

for i in range(N):
  price,currency=input().split()
  price=float(price)
  if currency == 'BTC':
    price=BTC_to_JPY*price
    
  price_sum=price_sum+price
  
print(price_sum)