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

Solution (Python):

def main():
    N = int(input())
    cnt = 0
    for i in range(N):
        x, u = input().split(' ')
        if u == 'JPY':
            cnt += float(x)
        else:
            cnt += float(x)*380000.0
    print('{}'.format(cnt))

if __name__ == "__main__":
    main()

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

Solution (Python):
BTC_RATE = 380000.0

N = input()
N = int(N)

x_list, u_list = [],[]
for i in range(N):
	x, u = list(input().split())
	x_list.append(float(x))
	u_list.append(u)

ans = 0.0
for x,u in zip(x_list, u_list):
	if u == "JPY":
		ans += x
	else:
		ans += x * BTC_RATE

print(ans)

Solution (Python):
N = int(input())
ans = 0
for _ 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())
ans = 0
for i in range(n):
    a, b = input().split()
    a = float(a)
    if (b == 'JPY'):
        ans += a;
    else:
        ans += a * 38000 * 10
print(ans)

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

total_jpy = 0
for i in range(n):
    x_str, u = input().split(' ')
    x = float(x_str)
    if u == 'JPY':
        total_jpy += x
    else:
        x_jpy = x * 380000.0
        total_jpy += x_jpy

print(total_jpy)

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

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

r = 380000
ans = 0
for _ in range(N):
    a, b = input().split()
    x = float(a)
    if b == 'BTC':
        x *= r
    ans += x

print(ans)

Solution (Python):


N = int(input())
x = [None] * N
u = [None] * N
for i in range(N):
    x[i], u[i] = input().split()
    x[i] = float(x[i]) if u[i] == 'JPY' else float(x[i]) * 380000.0
print(sum(x))

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

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

print(ans)

Solution (Python):
n=int(input())
X=[]
U=[]
ans=0
for i in range(n):
    x,u=input().split()
    x=float(x)
    X.append(x)
    U.append(u)

for i in range(n):
    if U[i]=='JPY':
        ans += X[i]
    else:
        ans += X[i]*380000
print(ans)

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

print(ans)

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

X = []
U = []
ans = 0

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

print(ans)

Solution (Python):
btc_to_yen = 380000.0
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*btc_to_yen
print(sum)

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

Solution (Python):
N = int(input())
x = []
u = []
for i in range(N):
  x1,u1 = input().split()
  x.append(float(x1))
  u.append(str(u1))
otoshidama = 0.0
for i in range(N):
  if u[i] == "JPY":
    otoshidama += x[i]
  else:
    otoshidama += x[i]*380000.0
print(otoshidama)

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

anss=0
for kane in kanes:
    if kane[1]=='BTC':
        anss+=float(kane[0])*380000
    else:
        anss+=float(kane[0])

print(anss)

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

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

Solution (Python):
N = int(input())
total_money = 0
for n in range(N):
    number, kind = map(str, input().split())
    if kind == 'JPY':
        total_money += int(number)
    else:
        total_money += float(number)*380000

print(total_money)

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

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

Solution (Python):
N = int(input())
L = [input().split() for _ in range(N)]
money_sum = 0
for value, type in L:
    if type == "JPY":
        money_sum += float(value)
    else:
        money_sum += float(value) * 380000
print(money_sum)

Solution (Python):



def main():
  N = int(input())
  li = [input().strip().split(' ')for _ in range(N)]
  yen = 0.0
  ratio = 380000.0
  for x, u in li:
    if u == 'JPY':
      yen += float(x)
    if u == 'BTC':
      yen += (ratio * float(x))
  print(yen)

  pass

if __name__=='__main__':
  main()

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

Solution (Python):
N = int(input())
x_list = []
u_list = []
for i in range(N):
    x_u = input().split(' ')
    x_list.append(float(x_u[0]))
    u_list.append(x_u[1])

sum = 0
for x, u in zip(x_list, u_list):
    if u == 'BTC':
        sum += 380000 * x
    elif u == 'JPY':
        sum += x

print(sum)

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

print(money)

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

ret = 0
for i in range(N):
    x, y = input().split()
    
    if y == "JPY":
        ret += int(x)
    else:
        ret += float(x) * 380000.0

print(ret)

Solution (Python):

n=int(input())

oto_list=[input().split() for i in range(n)]
cnt = 0

for j in range(n):
    if oto_list[j][1]=="JPY":
        cnt+=float(oto_list[j][0])
    else:
        cnt+=380000.0 * float(oto_list[j][0])
print(cnt)

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

total = 0
for _ in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'BTC':
        x = 380000.0 * x
    total += x
print(total)

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

    ans = 0
    for ai in a:
        x = ai[0]
        u = ai[1]
        if u == "JPY" :
            ans += x
        else:
            ans += 380000 * x

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
N = int(input())
table = np.array([[i for i in input().split()] for _ in range(N)])

vals = table[:, 0].astype(float)
conts = table[:, 1]

rates = (conts == "JPY") * 1 + (conts == "BTC") * 380000
s = (vals * rates).sum()
print(s)

Solution (Python):
n = int(input())
x = n*[0]
u = n*[0]
for i in range(n):
    x[i], u[i] = list(map(str, input().split(" ")))


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

print(ans)

Solution (Python):
n = int(input())
values = []
for i in range(n):

	values.append(input().split())

total = 0
for value in values:
	if value[1] == "JPY":
		total += int(value[0])
	if value[1] == "BTC":
		total += float(value[0]) * 380000.0

print(total)

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

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

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

m = 0

for i in range(N):
    a = input().rstrip().split(" ")
    x = float(a[0])
    u = a[1]    
    
    if u == "JPY":
        m += x
    else:
        m += x * 380000.0

print(m)

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

def solve():
    value = 0
    for i in range(N):
        if(u[i]=='BTC'):
            value = value + x[i]*380000.0
        else:
            value = value + x[i]
    return value
print(solve())

Solution (Python):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n = I()
ans = 0
for i in range(n):
    v,c = Ss()
    m = 1
    if c == "BTC":
        m = 380000
    ans += float(v)*m
print(ans)

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

res = 0

for x,u in in_num:
    if u == 'JPY':
        res+=float(x)
    else:
        res+= float(x)*380000.0

print(res)

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

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

Solution (Python):
N = int(input())
yen = 0
btc = 0
for _ in range(N):
    x, u = input().split()
    if u == 'JPY':
        yen += int(x)
    elif u == 'BTC':
        btc += float(x)
ans = yen + (btc * (38 * 10**4))
print(ans)

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

print(count)

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

for i in range(N):
    t1, t2 = input().split(" ")
    if t2 == "BTC":
        t1 = float(t1) * 380000.0
    else:
        t1 = float(t1)
    x += t1

print(x)

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

x = []
u = []

for i in range(N):
    X, U = input().split()
    x.append(float(X))
    u.append(U)

s = 0

for i in range(N):
    if u[i] == "JPY":
        s += x[i]
    elif u[i] == "BTC":
        s += x[i] * 380000

print(s)

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

Solution (Python):
N=int(input())
ans=0
for i in range(N):
  s,t=input().split()
  if t[0]=="J":
    ans+=int(s)
  else:
    ans+=float(s)*380000
print (ans)

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

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

ans = 0.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 = []
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] == 'JPY':
        ans += x[i]
    if u[i] == 'BTC':
        ans += x[i] * 380000
print(ans)

Solution (Python):

"""
Created on Sat Feb 16 20:52:46 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy


def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())
    
all(nstr.count(c) for c in '753')


ABT = zip(A, B, totAB)
result = 0

sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)


(x >> i) & 1


dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

"""

N = int(input())

x = [0]*N
u = [0]*N
result = 0
for n in range(N):
    x[n], u[n] = map(str, input().split())
    if u[n] == 'JPY':
        result += float(x[n])
    else:
        result += 380000.0*float(x[n])    
print(result)

Solution (Python):
N = int(input())
si = 0
sf = 0.0
for i in range(N):
    xs, us = input().split()
    if us == 'JPY':
        si += int(xs)
    else:
        sf += float(xs) * 380000.0

print(si + sf)

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

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

Solution (Python):
N = int(input())
x = []
u = []
for _ in range(N):
    a, b = input().split()
    x.append(float(a))
    u.append(b)
ans = 0
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())
ans = 0.0
for i in range(n):
    a, b = input().split()
    if b == "JPY":
        ans += float(a)
    else:
        ans += 380000.0 * float(a)

print(ans)

Solution (Python):



BTC = 380000.0


def main():
  n = int(input())
  gains = [tuple(input().split()) for _ in range(n)]
  rewards = [float(v) if u == 'JPY' else float(v) * BTC for v, u in gains]

  print('{:.5f}'.format(sum(rewards)))


if __name__ == '__main__':
  main()

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):
n = int(input())
x = [list(map(str,input().split())) for i in range(n)]
res = 0
for i in range(n):
    if x[i][1]=="JPY":
        res += int(x[i][0])
    else:
        res += float(x[i][0])*380000.0
print(res)

Solution (Python):
a=input()
result=0
for dummy in range(0,int(a)):
  str=input()
  str=str.split(' ')
  if(str[1]=='JPY'):
    k=1.0
  else:
    k=380000.0
  result+=float(str[0])*k

print(result)

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

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

otosilist=[]
for nth in range(n):
    okane=input().split(' ')
    otosilist.append([okane[0], okane[1]])


money=0

for olist in otosilist:
    if olist[1]=='JPY':
        money+=float(olist[0])
    else:
        money+=float(olist[0])*380000.0

print(money)

Solution (Python):
from functools import reduce
from operator import add

def solve():
  N = int(input())
  M = [0] * N
  for i in range(N):
    x, u = input().split()
    if u == 'JPY':
      M[i] = int(x)
    else:
      M[i] = float(x) * 380000.0
  return reduce(add, M)

print(solve())

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

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**7) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())
 
N = int(input())

ans = 0
for i in range(N):
    temp = input().split(" ")
    x = float(temp[0])
    u = temp[1]
    if u == 'BTC':
        x = x * 380000
    ans += x

print(ans)

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

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


print(s)

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

Solution (Python):
from sys import stdin

n = int(stdin.readline().strip())
ans = 0
for _ in range(n):
    x, u = stdin.readline().strip().split()
    if u == 'JPY':
        ans += int(x)
    if u == 'BTC':
        ans += 380000.0 * float(x)
print(ans)

Solution (Python):
ans = 0
for i in range(int(input())):
    a, b = input().split()
    ans += float(a) * (1 if b[0] == 'J' else 380000)
print('%.6f' % ans)

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

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

Solution (Python):
N = int(input())
X = [tuple(input().split()) for _ in range(N)]
ans = 0
for x, u in X:
    x = float(x)
    if u == 'BTC':
        x *= 380000
    ans += x

print(ans)

Solution (Python):



from collections import deque
import heapq
import math
import bisect


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

    print(S)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
result = 0.0
for i in range(N):
  x,t = input().rstrip().split(" ")
  if t == "JPY":
    result += float(x)
  else:
    result += float(x)*380000.0
print(result)

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

Solution (Python):
def btc2jpy(price):
    return 380000. * price

N = int(input())
sum_ = 0
for i in range(N):
    elms = input().split(" ")
    if elms[1] == "BTC":
        x = btc2jpy(float(elms[0]))
    else:
        x = int(elms[0])
    sum_ += x

print(sum_)

Solution (Python):


N = int(input())
X, U = [], []
sm = 0.0
RATE = 380000.0

for i in range(N):
    x, u = input().split()
    if u == "JPY":
        x = int(x)
        sm += x
    elif u == "BTC":
        x = float(x)
        sm += RATE * x
    else:
        raise ValueError("")

    X.append(x)
    U.append(u)

print(sm)

Solution (Python):
N = int(input())
ans = 0.0
for i in range(N):
    nums = input().split()
    if nums[1] == 'BTC':
        ans += 380000.0 * float(nums[0])
    else:
        ans += float(nums[0])
print(ans)

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

print(total)

Solution (Python):


N = int(input())
ans = 0.0

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

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

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

print(total)

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

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

ans = 0.0 
for i in range(N):
    x = float(XU[i][0])
    u = XU[i][1]
    if u == 'JPY':
        ans += x
    else:
        ans += x * 380000.0

print(ans)

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

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

def main():
	N = int(input())
	japan = 0
	bitcoin = 0.0
	for _ in range(N):
		X = input().split()
		if X[1] == 'JPY':
			japan += int(X[0])
		else:
			bitcoin += float(X[0])
	print(japan + bitcoin * 380000.0)

if __name__ == '__main__':
	main()

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

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

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

Solution (Python):
import sys
 
v = []
for line in sys.stdin:
    v.append([i for i in line.split()])
 
m = 0
for a, b in v[1:]:
  a = float(a)
  if b == "JPY":
    m += a
  else:
    m += 380000.0 * a
print(m)

Solution (Python):
from sys import stdin

def main():
    N = int(input())
    XU = [input().split() for _ in [0] * N]

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

input = lambda: stdin.readline().rstrip()
main()

Solution (Python):

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

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

print(ans)

Solution (Python):
BTC = 380000
ans = 0

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

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

Solution (Python):

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
n=I()
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):

from decimal import *
n = int(input())

res1 = Decimal(0)
res2 = Decimal(0)
for _ in range(n):
    x,u = input().split()
    if u=="JPY":
        res1 += Decimal(x)
    else:
        res2 += Decimal(x)*Decimal(380000.0)

print(res1+res2)

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

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

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

ans = 0.0

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

print(ans)

Solution (Python):
N = int(input())
ans = 0.00000000
for i in range(N):
  x, u = input().split()
  if u == "BTC":
    ans += float(x) * 3.8 * (10**5)
  else:
    ans += float(x)
print(ans)

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

print(m)

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

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

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

x = []

for i in range(N):
    X, U = list(map(str, input().split()))
    if U == 'BTC':
        X = float(X) * 380000.0
    x.append(float(X))

print(sum(x))

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

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

Solution (Python):

import math
import sys

n = int(sys.stdin.readline().rstrip())
ans = 0.0
for _ in range(n):
  x, u = list(map(str, sys.stdin.readline().rstrip().split()))
  if u == "JPY":
    ans += float(x)
  elif u == "BTC":
    ans += float(x) * 380000

print(ans)

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    s = 0
    for i in range(N):
        input_raw = read_func().strip().split()
        [x, u] = [float(input_raw[0]), (input_raw[1])]
        if u == "JPY":
            s += x
        else:
            s += x *380000.0
    print s




if __name__ == '__main__':
    main()

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] == 'JPY':
        c = 1
    else:
        c = 380000
    sum += float(x[i][0])*c
print(sum)

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

otoshidama=[ input().split() for i in range(N)]

BTC=380000.0
total=0

for i in otoshidama:
  if i[1]=='BTC':
    total+=float(i[0])*BTC
  else:
    total+=float(i[0])

print(total)

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

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

m = 0

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

print(m)

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

ans=0.0

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

print(ans)

Solution (Python):
import sys

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

print(ans)

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

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  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)


if __name__ == '__main__':
  main()

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