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()
    ans += float(x) * (1 if 'JPY' == u else 380000.0)
print('{:.8f}'.format(ans))

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

print(ans)

Solution (Python):
btc_rate = 380000.0

N = int(input())

otoshidama = 0
for i in range(N):
    x, v = input().split()
    if v == 'BTC':
        otoshidama += float(x) * btc_rate        
    else :
        otoshidama += int(x)
        
print(otoshidama)

Solution (Python):
import sys

def to_jpy(x, u):
    x = float(x)
    if u == 'BTC':
        x *= 3.8 * 10 ** 5
    return x

n, *xu = sys.stdin.read().split()
xu = zip(*[iter(xu)] * 2)

def main():
    res = 0
    for x, u in xu:
        res += to_jpy(x, u)
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

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

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

print(y)

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

Solution (Python):
N = int(input())
otoshidama = {'JPY': 0, 'BTC': 0}
for _ in range(N):
  val, cur = input().split()
  otoshidama[cur] += float(val)

print(otoshidama['JPY'] + (otoshidama['BTC'] * 380000.0))

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

Solution (Python):

n = int(input())
ans = 0.0

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

print(ans)

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

Solution (Python):

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

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

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

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

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

print(sum)

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

print(sum)

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

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

x_list = []
u_list = []
for _ in range(N):
    x, u = input().split()
    x_list.append(float(x))
    u_list.append(u)
ans = 0
for x, u in zip(x_list, u_list):
    if u == 'JPY':
        ans += x
    elif u == 'BTC':
        ans += x * 380000

print(ans)

Solution (Python):
p = {"JPY": 0, "BTC": 0}
for _ in range(int(input())):
    price, currency = input().split()
    price = float(price)
    p[currency] += price

print(p["JPY"] + 380000.0 * p["BTC"])

Solution (Python):
N=int(input())
M=[]
Y=[]
for i in range(N):
  n,a=input().split()
  M.append(float(n))
  Y.append(a)
m=0
r=380000
for i in range(N):
  if Y[i]=='JPY':
    m+=float(M[i])
  else:
    m+=float(M[i])*r
print(m)

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

def main():
    N = int(input())
    ans = 0
    for _ in range(N):
        x, u = [x for x in input().split()]
        if u == 'BTC':
            ans += float(x) * 380000.0
        else:
            ans += float(x)

    print(ans)

    

if __name__ == '__main__':
    main()

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

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

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

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

print(ans)

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

res = 0

for i in range(n):
    if a[i][1] == "JPY":
        res += int(a[i][0])
    else:
        res += 380000 * float(a[i][0])
print(res)

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

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

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

Solution (Python):
N = int(input())
ans = 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 = [0] * N
u = [0] * N
for i in range(N):
    x[i], u[i] = map(str, input().split())

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

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

Solution (Python):
n = int(input())
ans = 0
for _ in range(0, n):
  c, k = input().split()
  c = float(c)
  if k[0] == 'B':
    ans += 380000.0 * c
  else:
    ans += c
print(ans)

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

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

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

ans = 0

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

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

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

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

Solution (Python):


BIT_unit = 380000


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


print(total)

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

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

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

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


for x, u in money:
    if u == 'JPY':
        ans += x
    else:
        ans += 380000 * x

print(ans)

Solution (Python):
N = int(input())
total = 0
for i in range(N):
    m, CUR = input().split()
    if CUR == "BTC":
        total += float(m) * 380000.0
    else:
        total += int(m)

print(total)

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

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

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

Solution (Python):
n = int(input())
BTC = 38*10**4
ans = 0
for _ in range(n):
    x, u = input().split()
    x = int(x) if u == 'JPY' else float(x)*BTC
    ans += x
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())
x = [list(map(str, input().split())) for _ in range(n)]
jp = 0
bt = 0

for i in range(n):
    if x[i][1] == 'JPY':
        jp += int(x[i][0])
    elif x[i][1] == 'BTC':
        bt += float(x[i][0])

print(jp + 380000*bt)

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):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7



N = int(sys.stdin.buffer.readline())
XY = [sys.stdin.buffer.readline().decode().rstrip().split() for _ in range(N)]


ans = 0.0
for x, y in XY:
    if y == 'BTC':
        ans += float(x) * 380000.0
    else:
        ans += float(x)
print(ans)

Solution (Python):
N, *L,  = [s.split() for s in open(0)]
N = int(N[0])
cnt = 0
for l in L:
    if l[1] == "JPY":
        cnt += int(l[0])
    else:
        cnt += float(l[0]) * 380000
print(cnt)

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

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

ans = 0

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

print(ans)

Solution (Python):
n = int(input())
lix = []
liv = []
for i in range(n):
    x,v = input().split()
    lix.append(float(x))
    liv.append(v)

ans = 0

for i in range(n):
    if liv[i] == "JPY":
        ans += lix[i]
    else:
        ans += lix[i]*380000

print(ans)

Solution (Python):

n = int(input())
ans = 0

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

print(ans)

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


if __name__ == '__main__':
    solve()

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

print(cnt)

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

Solution (Python):
n=int(input())
a=[]
for i in range(n):
  x,v=input().split()
  a.append([x,v])
ans=0
for i in range(n):
  if a[i][1]=='BTC':
    ans+=380000*float(a[i][0])
  else:
    ans+=int(a[i][0])
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())
x = [list(input().split()) for i in range(N)]
ans = 0
for i in range(N):
  if x[i][1] == "JPY":
    ans += int(x[i][0])
  elif x[i][1] == "BTC":
    ans += float(x[i][0]) * 380000
print(ans)

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

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

l=[input().split() for i in range(a)]
for i in range(a):
  if l[i][1]=="JPY":
    l[i]=float(l[i][0])*1
  else:
    l[i]=float(l[i][0])*380000
    

print(sum(l))

Solution (Python):
n = int(input())
ans = 0
for _ in range(n):
    x, u = map(str, input().split())
    x = float(x)

    if u == "BTC":
        ans += x*380000
    else:
        ans += x
print(ans)

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

print(ans)

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

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

print(money)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
	n = INT()
	xu = [list(input().split()) for _ in range(n)]
	otoshidama = 0
	for x, u in xu:
		if u == 'JPY':
			otoshidama += int(x)
		else:
			otoshidama += float(x) * 380000

	print(otoshidama)

if __name__=='__main__':
	main()

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

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

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

Solution (Python):
def t(l_2d):
  return list(zip(*l_2d))
	
	
n = int(input())
a = [list(input().split()) for i in range(n)]
x,u = t(a)
x=map(float,x)



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

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

Solution (Python):

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

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

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

Solution (Python):
n = int(input())
v = [0] * n
for i in range(n):
    v[i] = list(input().split())
    v[i][0] = float(v[i][0])

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

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

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

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 += 380000 * float(s[0])

print(ans)

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
A = [[x for x in input().rstrip().split()] for _ in range(N)]
ans = 0
for i in A:
    if i[1] == "JPY":
        ans += int(i[0])
    else:
        ans += 380000 * float(i[0])
print(ans)

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

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

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

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

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

otoshidama = 0.0
for _ in range(n):
  money, unit = input().split()
  otoshidama += float(money) * (380000 if unit == "BTC" else 1)

print(otoshidama)

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

Solution (Python):
import sys
input = sys.stdin.readline
from decimal import Decimal,ROUND_HALF_UP
def print_ans(N, ar):
    """Test Case
    >>> print_ans(2, [["10000", "JPY"],["0.10000000", "BTC"]])
    48000.0
    >>> print_ans(3, [["100000000", "JPY"],["100.00000000", "BTC"],["0.00000001", "BTC"]])
    138000000.0038
    """
    ans = 0.0
    for a in ar:
        if a[1] == 'BTC':
            ans += float(Decimal(str(float(a[0]) * 380000.0)).quantize(Decimal('0.00001'), rounding=ROUND_HALF_UP) )
        else:
            ans += float(a[0])
    print(ans)


if __name__ == '__main__':
    N = int(input().rstrip())
    ar = [input().rstrip().split() for _ in range(N)]
    print_ans(N, ar)

Solution (Python):
n = int(input())
s = 0
f = lambda x: float(x[0]) if x[1] == 'JPY' else float(x[0]) * 380000.0
print(sum([f(input().split()) for _ in range(n)]))

Solution (Python):
N = int(input())
Xn = []
for _ in range(N):
    x,u = map(str,input().split(' '))
    if u == 'JPY':
        Xn.append(int(x))
    else:
        Xn.append(float(x) * 380000)
print(sum(Xn))

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

Solution (Python):
def examB():
    N = I()
    bit = 0; yen = 0
    for _ in range(N):
        x, u = LSI()
        if u=="JPY":
            yen +=float(x)
        else:
            bit +=float(x)
    ans = bit*380000 + yen
    print(ans)


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

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

Solution (Python):
n = int(input())
btc = 380000.0
def is_float(s):
  try:
    float(s)
  except:
    return False
  return True
def get_f(a):
  if is_float(a):
    return float(a)
  else:
    return(a)
fortune = [list(map(get_f,input().split())) for _ in range(n)]
jpy = [f[0] for f in fortune if f[1] == "JPY"]
bit = [f[0] for f in fortune if f[1] == "BTC"]
bit = list(map(lambda x:x*btc,bit))
print(sum(jpy)+sum(bit))

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 += x * 380000.0

print(ans)

Solution (Python):
n=int(input())
xl=[];ul=[]
for i in range(n):
  x,u=map(str,input().split())
  
  xl.append(float(x))
  ul.append(u)

btc=380000.0
ans=0.0
for i in range(n):
  if ul[i]=="BTC":
    ans+=xl[i]*btc
  else:
    ans+=xl[i]
print('{:.7f}'.format(ans))

Solution (Python):

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd



def divisor(n):
    """
    n の約数をリストで返す
    :param int n:
    :rtype: list of int
    """
    ret = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ret.append(i)
            if n // i != i:
                ret.append(n // i)
    return ret

def MI(): return map(int, input().split())


def main():
    N = int(input())
    BTC = 380000.0
    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import os, sys, re, math

N = int(input())

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

print(ret)

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

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

Solution (Python):
N = int(input())
XUs = []
w = 0.0
for n in range(N):
    x, u = [s for s in input().split(' ')]
    w += float(x) if u == 'JPY' else float(x) * 380000.0
    XUs.append((x, u))

print(w)

Solution (Python):
import os, sys, re, math

N = int(input())

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

print (total)

Solution (Python):
n = int(input())
ans = 0.0
for i in range(n):
  m, t = list(input().split(' '))
  m = float(m)
  if t == 'BTC':
    m *= 380000.0
  ans += m
print(ans)

Solution (Python):
ret = 0
for _ in range(int(input())):
    val, type = input().split()
    if type[0] == 'J':
        ret += float(val)
    else:
        ret += float(val) * 380000
print(ret)

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

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

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

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

Y = 0
for _ in range(N):
    t = input().split()
    x = float(t[0])
    u = t[1]
    if u == 'JPY':
        Y += x
    elif u == 'BTC':
        Y += x * 380000.0
print(Y)

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

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

ans = 0

for i in range(n):
    if ls_xu[i][1] == 'JPY':
        ans += float(ls_xu[i][0])
    elif ls_xu[i][1] == 'BTC':
        ans += float(ls_xu[i][0]) * 380000

print(ans)

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

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

print(sum)

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

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

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

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

cnt =0

for i in range(N):
    if list_aaa[i][1] =="JPY":
        cnt += int(list_aaa[i][0])
    elif list_aaa[i][1] =="BTC":
        cnt += float(list_aaa[i][0])*380000.0
print(cnt)

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

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

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

money = 0

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

print(money)

Solution (Python):

import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


n = int(input())
lists = [input().split() for i in range(n)]



ans = 0

for i in range(n):
	if lists[i][1] == 'JPY':
		ans = ans + float(lists[i][0])
	else:
		ans = ans + float(lists[i][0])*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, *xu = open(0).read().split()
X = list(map(float,xu[::2]))
U = xu[1::2]

sum_=0
for x, u in zip(X, U):
  if u == 'JPY':
    sum_+=x
  else:
    sum_+=x * 380000
print(sum_)

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

Solution (Python):
n = int(input())
money = []
for _ in range(n) :
    xi, yi = input().split()
    xi = float(xi)
    if yi == "JPY" :
        xi = xi
    elif yi == "BTC" :
        xi = xi * 380000.0
    money += [xi]
print(sum(money))

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

Solution (Python):
from decimal import Decimal
N = int(input())
X = []
btc_rate = Decimal("380000.0")
for _ in range(N):
    x, u = list(input().split())
    X.append([Decimal(str(x)), u])

ans = 0
for i in range(N):
    amount = X[i][0]
    unit = X[i][1]
    if unit == 'JPY':
        ans += amount
    else:
        ans += btc_rate * amount

print(ans)

Solution (Python):

n = int(input())

x = []
u = []

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

total_otoshidama = 0

for i in range(n):
    if u[i] == 'BTC':
        total_otoshidama += x[i] * 380000
    else:
        total_otoshidama += x[i]

print(total_otoshidama)