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())
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):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    ans = 0

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

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):





def main():
    N = int(input())
    x, u = [None] * N, [None] * N

    for i in range(N):
        line = input().split()
        x[i], u[i] = float(line[0]), line[1]
    
    jpy = 0
    btc = 0.0
    for i in range(N):
        if u[i] == "BTC":
            btc += x[i]
        else:
            jpy += x[i]
    
    return jpy + 380000.0 * btc


print(main())

Solution (Python):





def main():
    N = int(input())
    x, u = [None] * N, [None] * N

    for i in range(N):
        line = input().split()
        x[i], u[i] = float(line[0]), line[1]
    
    jpy = 0
    btc = 0.0
    for i in range(N):
        if u[i] == "BTC":
            btc += x[i]
        else:
            jpy += x[i]
    
    return jpy + 380000.0 * btc


print(main())

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n = int(input())

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

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):
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return list(sys.stdin.readline().rstrip().split())  

N = I()
xy = [LS() for _ in range(N)]

ans = 0
for i in range(N):
    x,y = xy[i]
    x = float(x)
    if y == 'JPY':
        ans += x
    else:
        ans += 380000*x

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]





N = ii()
A = [input().split() for _ in range(N)]

ans = 0
for num, s in A:
    if s == 'JPY':
        ans += int(num)
    else:
        ans += 380000.0 * float(num)

print(ans)

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

Solution (Python):
j = 0
b = 0

n = int(input())

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

Solution (Python):
s = 0
for i in range(int(input())):
    x, u = input().split()
    if u=='BTC':
        s += float(x)*38*(10**4)
    else:
        s += int(x)
print(s)

Solution (Python):
N = int(input())
X, U = [], []
T = 0
for _ in range(N):
  x, u = input().split()
  X.append(x)
  U.append(u)
for x, u in zip(X, U):
  if u == "JPY":
    T += int(x)
  else:
    T += float(x)*380000.0
print(T)

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

ans = 0
for dm in dms:
    if dm[1] == 'JPY':
        ans += float(dm[0])
    else:
        ans += float(dm[0]) * 380000
print(ans)

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

Solution (Python):
import sys
N = int(input())
array = [ list(map(str,input().split())) for I in range(N) ]

for I in array:
    if not ( I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 ) and \
    not ( I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 ): sys.exit()

amount = 0
for I in array:
    if I[1] == 'JPY': amount += int(I[0])
    if I[1] == 'BTC': amount += float(I[0]) * 380000

print(amount)

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

Solution (Python):
N = int(input())
Price = 0
Rate  = 380000
for T in range(0,N):
    X,U = input().split()
    if U=='JPY': Price += int(X)
    else: Price += float(X)*Rate
print(Price)

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
ans = 0
for _ in range(n):
  a, b = rs()
  if b == 'JPY':
    ans += float(a)
  else:
    ans += float(a)*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):
def main():
    N = int(input())
    data = [input().split() for _ in range(N)]
    sum = 0
    for d in data:
        if d[1] == "JPY":
            sum += int(d[0])
        else:
            sum += float(d[0]) * 380000
    print(sum)


if __name__ == '__main__':
    main()

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

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

    
print(ans)

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

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

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

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

Solution (Python):
n=int(input())
sumx=0
for i in range(n):
  x_,u_=map(str,input().split())
  x_=float(x_)
  if u_=='BTC':
    x_=float(380000)*x_
    sumx+=x_
    
  else:
    sumx+=float(x_)
    
print(sumx)

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

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

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

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

print(ans)

Solution (Python):
res=0
for i in range(int(input())):x,u=input().split();x=float(x);res+=x if u>'C'else 380000*x
print(res)

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

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 += (380000 * x)
print(res)

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

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

print(a)

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

Solution (Python):
from decimal import Decimal

N = int(input())
X = []
U = []
total = Decimal(0)
for _ in range(N):
    x, u = input().split()
    d = Decimal(x)
    if u == "JPY":
        total += d
    else:
        total += d * 380000
print(total)

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

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

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

for i in range(n):
    if x[i][1] == 'JPY':
        c += int(x[i][0])
    else:
        y = float(x[i][0]) * 380000.0
        c += y

print(c)

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

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

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

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    x,u = list(input().split())
    if u == 'JPY':
        ans += float(x)
    else:
        ans += float(x)*3.8*10**5
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*380000
print(ans)

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

ans = 0
for i in range(N):
    X, U = map(str, input().split())
    if U == 'BTC':
        X = float(X)*380000
    ans += float(X)

print(ans)

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

for i in range(N):
    a,b = input().split()
    a = float(a)
    if b == "BTC":
        a *= 380000.0
    mass.append(a)

print(sum(mass))

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(raw_input())
q= 0 
for _ in range(n):
	u,v = raw_input().split(' ')
	u = float(u)
	h = {'BTC':380000.0, 'JPY':1.0}
	q += u * h[v]
print q

Solution (Python):
from decimal import Decimal
def main():
    n = int(input())
    xu = [input().split() for _ in range(n)]
    c = Decimal("0")
    for x,u in xu:
        if u == "JPY":
            c += Decimal(x)
        else:
            c += Decimal(x)*Decimal("380000.0")
    print(c)
    
if __name__ == "__main__":
    main()

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

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

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

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

ans=0
for x,y in xy:
    if y=='JPY':
        ans+=int(x)
    else:
        ans+=float(x)*380000

print(ans)

Solution (Python):
def solve():
    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)



if __name__ == '__main__':
    solve()

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

Solution (Python):
import sys
import math
import decimal
read = sys.stdin.read
readline = sys.stdin.buffer.readline
INF = float('inf')


def main():
    N = int(readline())
    JPY = 0
    BTC = 0
    for _ in range(N):
        x, u = readline().decode('utf-8').strip().split()
        if u == 'JPY':
            JPY += int(x)
        else:
            BTC += decimal.Decimal(x)

    ans = JPY + BTC*380000
    print(ans)
if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
n = int(input())
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())
sum_otoshidama = 0
for _ in range(N):
    x, u = input().split()
    if u == 'JPY':
        sum_otoshidama += float(x)
    elif u == 'BTC':
        sum_otoshidama += (float(x) * 380000)
print(sum_otoshidama)

Solution (Python):
(n), *l,  = [list(s.split()) for s in open(0)]

sum_m = 0
for x, y in l:
    
    
    x = float(x)
    if y == 'JPY':
        sum_m += x
    if y == 'BTC':
        sum_m += (x * 380000.0)
        
print(sum_m)

Solution (Python):

import sys


def solve(N: int, x: "List[float]", u: "List[str]"):
    d = {'JPY': 1, 'BTC':380000}
    return sum(xx * d[uu] for xx, uu in zip(x, u))


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)
    print(solve(N, x, u))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

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

Solution (Python):
n = int(input())
apple = []
for _ in range(n):
    apple.append(list(map(str, input().split())))
count = 0
for i in apple:
    if i[1] == "JPY":
        count += int(i[0])
    else:
        count += 38e4 * float(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=[input().split() for i in range(N)]
print(sum([float(x)*{"JPY":1, "BTC":380000}[u] for x,u in XU]))

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()

    ans = 0

    for i in range(N):
        x, u = readline().rstrip().split()
        x = float(x)
        u = u.decode()
        if u == 'JPY':
            ans += x
        elif u == 'BTC':
            ans += x * 380000

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

n = int(input())
ans = 0
for i 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())
y=[]
t=[]
l=[]
for i in range(n):
    x,u=input().split()
    y.append(float(x))
    t.append(u)
for i in range(n):
    if t[i]=='JPY':
        l.append(y[i])
    else:
        l.append(y[i]*380000.0)
print(sum(l))

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

TO_JPY = {"JPY": 1, "BTC": 380000}

ans = 0

for i in range(N):
    x, u = input().split()
    x = float(x)
    ans += x * TO_JPY[u]
    
print(ans)

Solution (Python):
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    count = 0

    for i in range(n):
        b, c = map(str, input().split())
        if c =="JPY":
            count+=int(b)
        else:
            count+=  Decimal(380000 ) * Decimal(b)

    print(count)

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


yen = 0
btc = 0
for i,j in a:
  if j == 'JPY':
    yen += int(i)
  else:
    btc += float(i)

print(yen + btc * 380000)

Solution (Python):
def mi():
    return map(int, input().split())

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

    print(s)


if __name__ == '__main__':
    main()

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):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N = int(input())
ans = 0
for n in range(N):
    x, u = map(str, input().split())
    x = float(x)
    if not u=='JPY':
        x *= 380000.0
    ans += x
print(ans)

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

ans = 0
for i in range(N):
  a,b = input().split()
  a = float(a)
  if b == "JPY":
    ans += a
  else:
    ans += f*a
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())

mlis = []
jblis= []
for _ in range(n):
    a, b = input().split()
    mlis.append(float(a))
    jblis.append(b)
    
    
total = 0
for i in range(n):
    if jblis[i] == 'JPY':
        total += mlis[i]
    else:
        total += mlis[i]*380000.0

print(total)

Solution (Python):
def actual(n, X, U):
    
    amount_yen = 0

    for x, u in zip(X, U):
        if u == 'JPY':
            amount_yen += x
        if u == 'BTC':
            amount_yen += x * 380000.0

    return amount_yen

n = int(input())
X = []
U = []

for _ in range(n):
  x, u = input().split()
  X.append(float(x))
  U.append(u)
  
print(actual(n, X, U))

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

Solution (Python):
import math
def ip():return int(input())
def inp():return map(int,input().split())
def inpstr():return map(str,input().split())
def linp():return list(map(int,input().split()))
def linpstr():return list(map(str,input().split()))

yen=0
coin=0
ans=0
for _ in range(ip()):
    x,u=inpstr()
    x=float(x)
    if u=="BTC":x=x*380000.0
    ans+=x
print(ans)

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

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

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

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

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

print(sum)

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

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

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):
from decimal import Decimal
N = int(input())
A = [list(input().split()) for _ in range(N)]
ans = 0
for x,u in A:
    if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x)*380000
print(ans)

Solution (Python):
from decimal import Decimal
N = int(input())
A = [list(input().split()) for _ in range(N)]
ans = 0
for x,u in A:
    if u == 'JPY':
        ans += int(x)
    else:
        ans += Decimal(x)*380000
print(ans)

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

Solution (Python):






from collections import deque



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

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

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

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

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

Solution (Python):
import sys
import math
from collections import Counter
import itertools
import fractions
import datetime
from decimal import Decimal



def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())

def LI(): return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



N=II()
XU=[list(SR().split()) for _ in range(N)]
ans = 0

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

Solution (Python):
import decimal

n = int(input())

ans = 0
for i in range(n):
    x, v = input().split()
    if v == 'JPY':
        ans += int(x)
    else:
        a = decimal.Decimal(x)
        b = decimal.Decimal(380000)
        c = a * b
        ans += c

print(ans)

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

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

Solution (Python):
N = int(input())
K = 380000
ans = 0
import decimal
for _ in range(N):
    x, u = input().split()
    if u == "BTC":
        ans += K * decimal.Decimal(x)
    else:
        ans += int(x)
print(ans)

Solution (Python):


n = int(input())

bit = 380000

ans = 0
for i in range(n):
    value, type_ = list(map(str, input().split()))
    value = float(value)
    if type_ == "JPY":
        ans += value
    else:
        ans += bit*value
print(ans)

Solution (Python):
n=int(input())
ans=0
for _ in range(n):
  ans+=eval(input().replace(' ','*').replace('JPY','1').replace('BTC','380000'))
print(ans)

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

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

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

ans = 0.0

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

print(ans)

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

Solution (Python):
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())
res = 0
for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        res += float(x)
    elif u == 'BTC':
        res += float(x) * 380000.0
print(res)

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

xu = [0]*n

for i in range(n):
  xu[i] = input().split()
  
ans = []

for i in range(n):
  if(xu[i][1] == "BTC"):
    ans.append(float(xu[i][0])*380000.0)
  else:
    ans.append(int(xu[i][0]))
print(sum(ans))

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

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

Solution (Python):
C = 380000.0

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

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

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

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

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

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

    x= float(x)

    if u=='JPY':
        total+=x
    else:
        btc+=x

total += btc*380000

print(total)

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

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

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

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

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

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