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

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

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


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

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

Solution (Python):
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") 

btc_price = 380000.0

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

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

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


resolve()

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

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

ans = 0

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

print(ans)

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

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

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

Solution (Python):

N = int(input())

otoshidama = 0
BTC_rate = 380000.0
for i in range(1, N + 1):
    x, u = map(str, input().split())
    
    
    if u == "BTC":
        otoshidama += float(x) * BTC_rate
    else:
        otoshidama += float(x)

print(otoshidama)

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

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

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

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=list(input().split())
   if B=="JPY":
      ans+=int(A)
   else:
      ans+=float(A)*380000
print(ans)

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

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

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

Solution (Python):
n=int(input())
xu=[]
total=0
for i in range(n):
    xu.append([x for x in input().split()])

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

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

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

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

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

for i in range(N):
    a=input().split()
    if a[1]=='JPY':
        ans+=int(a[0])
    else:
        ans+=float(a[0])*380000

print(ans)

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

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

print(sum)

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

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):
import sys
inp = sys.stdin.buffer.readline

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

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())
su = 0
for i in range(N):
  s = input()
  x = float(s[:-4])
  if s[-3:] == "JPY":
    su += x
  else:
    su += x*380000
    
print(su)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def main():
    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)


if __name__ == "__main__":
    main()

Solution (Python):
import sys
import math
import bisect

def main():
    ans = 0
    for _ in range(int(input())):
        a, b = input().split()
        a = float(a)
        if b == 'JPY':
            ans += a
        elif b == 'BTC':
            ans += a * 380000
    print('%.10f' % ans)

if __name__ == "__main__":
    main()

Solution (Python):


import sys






















def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    ans = 0
    n = ii()
    for _ in range(n):
        x, u = input().split()
        x = float(x)
        if u == 'JPY':
            ans += x
        else:
            ans += 380000 * x
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
x= [""]*(N+1)
u= [""]*(N+1)

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

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

  
print(sum)

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())
x = [list(input().split()) for _ in range(n)]
BTC = 380000.0
YEN = 1
ans = 0
for i in x:
    if i[1] =='BTC':
        ans += float(i[0]) * BTC
    else:
        ans += float(i[0]) * YEN
print(ans)

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

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()
ans = 0
for i in range(n):
    x, u = Ss()
    if u == "BTC":
        ans += float(x)*380000.0
    else:
        ans += float(x)
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
    elif u == "BTC":
        ans += x * 380000
print(ans)

Solution (Python):
n=int(input())
l=[]
while n>0:
    s,y=map(str,input().split())
    if y=='JPY':
        k=int(s)
        l.append(k)
        n-=1
    else:
        j=float(s)*380000
        l.append(j)
        n-=1
print(sum(l))

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):
n = int(input())
otoshidama = 0.0
for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        otoshidama += float(x)
    else:
        otoshidama += float(x) * 380000.0
print(otoshidama)

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


sum=0
for i in range(n):
    if u[i]=="JPY":
        sum+=x[i]
    elif u[i]=="BTC":
        sum+=x[i]*380000.0
print(sum)

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

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

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

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

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

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

Solution (Python):

import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, x: "List[float]", u: "List[str]"):
    rate = 380000.0
    print(sum(xi * (rate if ui == "BTC" else 1.0) for xi, ui 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)
    solve(N, x, u)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
l = []
b = int(380000)
t = 0

for i in range (N):
  l.append(list(map(str, input().split())))
  
for j in range (N):
  
  if l[j][1] == "BTC":
    t += float(l[j][0])*b
    
  else:
    t += float(l[j][0])
    
print(t)

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())
money = [input().split() for i in range(N)]

JPY = [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY']
BTC = [float(money[i][0]) * 380000 for i in range(N) if money[i][1] == 'BTC']

print(sum(JPY) + sum(BTC))

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    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)
resolve()

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

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

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

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

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

Solution (Python):
import itertools
import math
import fractions
import functools

n = int(input())
dic = {"JPY":0, "BTC":0}
for i in range(n):
    l = list(input().split())
    if l[1] == 'JPY':
        dic["JPY"] += float(l[0])
    if l[1] == 'BTC':
        dic["BTC"] += float(l[0])

print(dic["JPY"] + 380000*dic["BTC"])

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

ans = 0
for money in moneies:
    if money[1] == "JPY":
        ans += int(money[0])
    else:
        ans += float(money[0]) * 380000
print(ans)

Solution (Python):
cost = 0
n = int(input())
for _ in [0] * n:
    s = input().split()
    x, u = float(s[0]), s[1]
    if u == "BTC":
        cost += x * 38e4
    else:
        cost += x
print(cost)

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

b=380000
res=0

for _ in range(n):
	x,u=input().split()
	x=float(x)
	if u=="BTC":
		x*=b
	res+=x
	
print(res)

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

Solution (Python):
N = int(input())
a = []
for i in range(N):
  x, u = list(input().split())
  x = float(x)
  if u == "BTC":
    x = 380000.0*x
  a.append(x)
  
print(sum(a))

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

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

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

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

otosidama = 0.0
bit = 380000
for i in range(n):
    x, v = input().split()

    if v == 'JPY':
        otosidama += float(x)
    else:
        otosidama += float(x) * bit
print(otosidama)

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

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

Solution (Python):

import sys
input = sys.stdin.readline









N = int(input())
XU = [tuple(input().split()) for _ in range(N)]

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

Solution (Python):
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))

def main(n,l):
    res = 0
    for x,u in l:
        res += calc(x,u)
    return res
    
def calc(x,u):
    return int(x) if u == "JPY" else float(x) * 380000

n = ii()
l = list([input().split() for _ in range(n)])
print(main(n,l))

Solution (Python):
n = int(input())
money = 0
for _ in range(n):
  p = input().split()
  if p[1] == 'JPY':
    money += int(p[0])
  elif p[1] == 'BTC':
    money += float(p[0]) * 380000

print(money)

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

print(total)

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

ans = 0

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

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

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

print(cnt)

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

Solution (Python):


n = int(input())

z = 0
for i in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        z += x
    else:
        z += x*380000
print(z)

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

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

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

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

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


n=I()
ans=0
for i in range(n):
    u=input().rstrip().split(" ")
    a=float(u[0])
    s=u[1]
    if s=="JPY":
        ans+=a
    else:
        ans+=a*380000
print(ans)

Solution (Python):


N = int(input())
ans = 0
xrate = 380000

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

print(ans)

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

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

Solution (Python):

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

print(ans)

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

Solution (Python):

def solve():

    N = int(input())
    xlist = []

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

    print(sum(xlist))


if __name__ == "__main__":
    solve()

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

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

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

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

Solution (Python):

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

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

print(ans)

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

for i in range(n):
    if xu[i][1] == 'JPY':
        sum_xu += xu[i][0]
    elif xu[i][1] == 'BTC':
        sum_xu += xu[i][0]*380000.0

print(sum_xu)

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

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

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

Solution (Python):
N = int(input())
x = list()
u = list()

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

sm = 0

for a, b in zip(x, u):
    if b == 'BTC':
        sm += a*380000
    else:
        sm += a

print(sm)

Solution (Python):

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

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

Solution (Python):
def digital_gifts(n, xuli):

    ans = 0

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

    return ans

def main():
    n = int(input())
    xuli = [list(map(str, input().split())) for i in range(n)]
    print(digital_gifts(n, xuli))

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ans = 0
for _ in range(n):
    m,t = input().split()
    m = float(m)
    if t == 'JPY':ans+=m
    else:ans+= m*380000.0
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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
xu = [input().split() for _ in range(N)]
ans = 0

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

print(ans)

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


for a, b in zip(X, U):
    if b == "BTC":
        result.append(380000 * a)
    else:
        result.append(a)

print(sum(result))

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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

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):
N = int(input())
money, type = [], []
for i in range(N):
    m, t = input().split()
    money.append(float(m))
    type.append(t)

sum = 0
for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5
print(sum)

Solution (Python):
N = int(input())
money = []
type = []
for i in range(N):
    m, t = input().split()
    money.append(float(m))
    type.append(t)
    
sum = 0
for i in range(N):
    if type[i] == 'JPY':
        sum += money[i]
    else :
        sum += money[i]*3.8*10**5
print(sum)

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

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


calculate_yen = lambda xyi: int(xyi[0]) if xyi[1] == 'JPY' else float(xyi[0]) * 380000.0
calculate_total_yen = lambda xy : sum(map(calculate_yen, xy))

total = calculate_total_yen(xy)

print(total)

Solution (Python):

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


calculate_yen = lambda xyi: int(xyi[0]) if xyi[1] == 'JPY' else float(xyi[0]) * 380000.0
total = sum(map(calculate_yen, xy))

print(total)