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

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

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

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

btc = 380000.0

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

print(ans)

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


main()

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

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

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

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

print("{:.10f}".format(ans))

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

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

print(y)

Solution (Python):
N = int(input())
x = []
u = []
for _ in range(N):
    a, b = input().split()
    x.append(float(a))
    u.append(b)
ans = sum(t[0] if t[1] == 'JPY' else t[0] * 380000 for t in zip(x, u))
print(ans)

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

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

print(ans)

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

ans = 0
for _ 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):
    x, u = map(str, input().split())
    if u == "JPY":
        ans += int(x)
    else:
        ans += (float(x) * 380000)

print(ans)

Solution (Python):
N = int(input())
ans = 0
coeff = 380000.0
for _ in [0]*N:
    x, u = input().rstrip().split()
    x = float(x)
    if u == 'JPY':
        ans += x
    elif u == 'BTC':
        ans += x * coeff
print('%.06f' % ans)

Solution (Python):
n = input()
val = 380000.0
ans = 0.0
for i in xrange(n):
	a,b = raw_input().split()
	a = float(a)
	if b == 'BTC':
		ans += a*val
	else:
		ans += a

print '%.9f' %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())
index=0
sum=0
while index < n:
    x, u = map(str, input().split())
    if u == "JPY":
        sum+=float(x)
    else:
        sum+=380000*float(x)
    index+=1
print(sum)

Solution (Python):
import sys

input = sys.stdin.readline
n = int(input())
money = 0.0
for _ in range(n):
    x, u = map(str, input().split())
    if u == 'BTC':
        money += float(x) * 380000.0
    else:
        money += float(x)
print(money)

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

Solution (Python):
N=int(input())
ANS=0
for i in range(N):
    x,u=input().split()

    if u[0]=="J":
        ANS+=int(x)
    else:
        ANS+=float(x)*380000

print(ANS)

Solution (Python):

def main():
    a = int(input())
    ans = 0
    for i in range(a):
        b = input().split()
        if b[1] == 'JPY':
            ans += int(b[0])
        else:
            ans += float(b[0]) * 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 == "JPY":
        ans += x
    else:
        ans += 380000.0 * x
print(ans)

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

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

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

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

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

Solution (Python):


N = int(input())
x = [None] * N
u = [None] * N
for i in range(N):
    a, b = input().split()
    x[i] = float(a)
    u[i] = b

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

print(output)

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

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())
cnt = 0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == 'JPY':
        cnt += x
    else:
        cnt += 380000*x

print(cnt)

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

ans = 0
for content in xu_list:
    x_ , u_ = content
    if u_ == "JPY":
        ans += int(x_)
    else:
        ans += float(x_) * 380000
print(ans)

Solution (Python):
N = int(input())
L = [input().split() for _ in range(N)]
S = sum([int(x) if u == "JPY" else float(x) * 380000 for x, u in L])
print(S)

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

Solution (Python):


import sys


INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()
ans = 0
for _ in range(n):
    x, u = LS()
    x = float(x)
    if u == 'BTC':
        x *= 380000
    ans += x
print(ans)

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

R = 0

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

print(R)

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

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

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

print(otoshidama)

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.0*x
print(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):

"""
This file is part of https://github.com/cheran-senthil/PyRival
Copyright 2019 Cheran Senthilkumar <hello@cheran.io>

"""
from __future__ import division, print_function

import itertools
import os
import sys
from atexit import register
from io import BytesIO


class dict(dict):
    """dict() -> new empty dictionary"""

    def items(self):
        """D.items() -> a set-like object providing a view on D's items"""
        return dict.iteritems(self)

    def keys(self):
        """D.keys() -> a set-like object providing a view on D's keys"""
        return dict.iterkeys(self)

    def values(self):
        """D.values() -> an object providing a view on D's values"""
        return dict.itervalues(self)


def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x


range = xrange

filter = itertools.ifilter
map = itertools.imap
zip = itertools.izip

sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))

input = lambda: sys.stdin.readline().rstrip('\r\n')


def main():
    n = int(input())
    worth = 0

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

    print(worth)


if __name__ == '__main__':
    main()

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
    else:
        ans += int(x)

print(ans)

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

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

print(total)

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

btc = 380000

n = ni()

ans = 0
for _ in range(n):
    s = ls()
    num = float(s[0])
    typ = s[1]
    
    if typ == "JPY":
        ans += num
    else:
        ans += num * btc
        
print(ans)

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

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

BTCRate = 380000.0

result = 0
for x, u in xuList:
    if u == 'JPY':
        result += x
    else:
        result += (BTCRate * x)

print(result)

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

Solution (Python):
n = int(input())
ans = 0
d = { 'JPY': 1, 'BTC': 380000.0}
for _ in range(n):
  a, b = input().split()
  ans += float(a) * d[b]
print(ans)

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


print(ans)

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

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

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

print(ans)

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

Solution (Python):
def solve(N, XUs):
    p = 380000.0
    ans = 0
    for x, u in XUs:
        if u == "BTC":
            ans += float(x) * p
        else:
            ans += float(x)
    return ans


if __name__ == "__main__":
    N = int(input())
    XUs = list(tuple(input().split(" ")) for _ in range(N))
    print(solve(N, XUs))

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

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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

ans = 0
N = int(input())
for n in range(N):
    x, u = input().split()
    if u == 'JPY':
        ans += int(x)
    else:
        ans += float(x) * 380000.0
print("{:.9f}".format(ans))

Solution (Python):
N = int(input())
res = 0
for i in range(N):
    x, u = input().split()
    x = float(x)

    if u == 'BTC':
        x *= 380000

    res += x

print('{:.12f}'.format(res))

Solution (Python):
N = int(input())
ans = 0
for _ 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
X = [  input().split() for _ in range(N)]

for i in range(N):
    x,u = X[i]
    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()
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += (380000.0 * x)
    
print(ans)

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

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

result = 0

for x, u in XU:
    if u == "JPY":
        r = float(x)
    else:
        r = float(x) * 380000.0
    result += r

print(result)

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

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


print(s)

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

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

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