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())
x_list=[]
u_list=[]
for i in range(n):
  x,u=input().split()
  x_list.append(float(x))
  u_list.append(u)
sum=0
for i in range(n):
  if u_list[i]=="JPY":
    sum+=x_list[i]
  else:
    sum+=x_list[i]*380000.0
print(sum)

Solution (Python):
n = int(input())
list_bonus = [[s for s in input().split()] for j in range(0, n)]
ans = 0.0
for i in range(0, n):
    if list_bonus[i][1] == "JPY":
        ans += float(list_bonus[i][0])
    else:
        ans += float(list_bonus[i][0]) * 380000.0
print(ans)

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

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

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

    else :
        ans += xu[i][0]*380000

print(ans)

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

result = 0

for _ in range(N):
  x, u = input().split()
  x = float(x)
  
  if u == "JPY":
    result += x
  else:
    result += x * (3.8 * 10 ** 5)
    
print(result)

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

ab = [list(input().split()) for _ in range(n)]
jpy =0
btc =0

for i in range(n):
    if ab[i][1] =="JPY":
        jpy += float(ab[i][0])
    
    elif ab[i][1] =="BTC":
        btc += float(ab[i][0])

print (jpy + btc *380000.0)

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())
D={'JPY':1, 'BTC':380000}
a=0
for _ in range(N):
  v,s=list(input().split())
  a+=float(v)*D[s]
print(a)

Solution (Python):
n = int(input())
c = 0
for i in range(n):
    y, t = input().split()
    if t == 'BTC':
        yen = float(y)*380000.0
    else:
        yen = float(y)
    c += yen

print(c)

Solution (Python):

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

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

s=0

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

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

ans = 0
for _ in range(n):
    x, u = input().split()
    if u == 'JPY':
        ans += int(x)
    else:
        ind = x.index('.')
        ans += int(x[:ind]) * 380000
        ans += int(x[ind+1:]) * 38 / 10000

print(ans)

Solution (Python):
n = int(input())
ans = 0.0
rate = 380000.0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    ans += float(a)
  else:
    ans += (float(a)*rate)
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())
ans = float(0)
for _ in range(n):
  m, u = input().split()
  m = float(m)
  if u == 'JPY':
    ans += m
  else:
    ans += m * float(380000)
print(ans)

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

Solution (Python):
def mapt(fn, *args):
    return tuple(map(fn, *args))
  

def Vector(line):
    return mapt(Atom, line.split(" "))


def Atom(segment):
    try:
        return float(segment)
    except ValueError:
        try:
            int(segment)
        except ValueError:
            return segment

def main():
    n = int(input())
    data = [Vector(input()) for _ in range(n)]
    total = 0
    for amount, currency in data:
        if currency == "JPY":
            total += amount
        else:
            total += amount * 380000
    print(total)

main()

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

cnt=0

for i in range(n):
  m[i][0]=float(m[i][0])
  if m[i][1]=='BTC':
    m[i][0]*=380000.0
  cnt+=m[i][0]

print(cnt)

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

if '__main__' == __name__:
    resolve()

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

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

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

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

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

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

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

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())
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):
a=int(input())
b=[input().split() for i in range(a)]
c=0
for i in range(a):
  if b[i][1]=="JPY":
    c=c+int(b[i][0])
  if b[i][1]=="BTC":
    c=c+float(b[i][0])*380000
print(c)

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

Solution (Python):
N = int(input())
btc_a = 380000.0
btc_b = btc_a / (10 ** 8)
ans = 0.0
for i in range(N):
  x, n = input().split()
  if n == "JPY":
    ans += int(x)
  else:
    a, b = map(int, x.split("."))
    ans += a * btc_a
    ans += b * btc_b
print(ans)

Solution (Python):
def main():
    n = int(input())
    gift = 0

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

    print(gift)


if __name__ == "__main__":
    main()

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

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.0

print(ans)

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

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

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

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

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

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

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

jpy = 0
btc = 0

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

Solution (Python):
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    BB=380000
    ans =0
    N =int(input())

    for i in range(N):
        x,v =input().split()
        if v =="JPY":
            ans +=int(x)
        else:
            ans +=BB*float(x)

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):


num = int(input())
total = 0
for i in range(num):
    money, code = input().split()
    if code == "JPY":
        total += float(money)
    elif code == "BTC":
        total += float(money) * 380000.0
print(total)

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    xu = [LSS() for _ in range(N)]

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

    print(ans)

if __name__ == '__main__':
    resolve()

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())
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())
x=[]
for i in range(n):
  a,b = input().split()
  if b == 'JPY':
    x.append(int(a))
  else:
    x.append(float(a)*380000)
print(sum(x))

Solution (Python):
n = int(input())
jpy = 0
btc = 0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jpy += int(a)
  else:
    btc += int(float(a) * 100000000)
print(jpy+(btc*38/10000))

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

Solution (Python):
bit = 380000.0

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 * bit
print(ans)

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

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

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

print(ans)

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

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

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

Solution (Python):
def readinput():
    n=int(input())
    dama=[]
    for _ in range(n):
        a,b=input().split()
        dama.append((a,b))
    return n,dama

def main(n,dama):
    sum=0.0
    for x,u in dama:
        if u=='JPY':
            sum+=int(x)
        else:
            sum+=float(x)*380000.0
    return sum

if __name__=='__main__':
    n,dama=readinput()
    ans=main(n,dama)
    print(ans)

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

print(ret)

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

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())

    ans = 0
    rate = 380000.0
    for _ in range(N):
        x, u = readline().split()
        if u == 'JPY':
            ans += int(x)
        else:
            ans += float(x) * rate

    print(ans)
    return


if __name__ == '__main__':
    main()

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

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

Solution (Python):
N=int(input())
xu=[]
for i in range(N):
    xu.append(list(map(str,input().split())))
a=0
for i in range(N):
    if xu[i][1]=='JPY':
        a+=float(xu[i][0])
    if xu[i][1]=='BTC':
        a+=float(xu[i][0])*(380000.0)
print(a)

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

ans = jpy+380000.0*btc
print(ans)

Solution (Python):
N = int(input())
moneys = [tuple(map(str, input().split())) for _ in range(N)]
rate = 380000

total = 0
for money in moneys:
    x, u = money
    x = float(x)
    if u == 'JPY':
        total += x
    else:
        total += x * rate

print(total)

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

p = 0

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

print(p)

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):
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n, = [int(num) for num in lines.pop(0).split(" ")]
def iter_value_and_unit():
    for line in lines:
        value, unit = line.split(" ")
        value = float(value)
        if unit == "BTC":
            yield 380000.0 * value
        else:
            yield value

print(sum(iter_value_and_unit()))

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())
J,B=0,0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        J+=int(x)
    else:
        B+=float(x)

ans=J+B*380000
print(ans)

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

money_sum = 0

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

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

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

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

Solution (Python):
n = int(input())
otoshidama = []
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        otoshidama.append(x)
    else:
        otoshidama.append(x*380000)
ans = sum(otoshidama)
print(f"{ans:.5f}")

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

JPY = 0
BTC = 0
for i in range(N):
	a, b = input().split()
	if b == 'JPY':
		JPY += float(a)
	else:
		BTC += float(a)
print(JPY + 380000.0 * BTC)

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())
l = [list(map(str,input().split())) for i 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.0
print(ans)

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

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

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

print(ans)

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

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

ans = 0

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

print(ans)

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
J = 0
B = 0
for _ in range(N):
    x, u  = map(str, input().split())
    if u == 'JPY':
        J += int(x)
    else:
        B += float(x)
ans = J + 380000*B
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 += float(x[i])
    else:
        ans += float(x[i]) * 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:
        x = x.replace(".","")
        ans += (int(x) * 380000 / 10**8)
print(str(ans))

Solution (Python):
n = int(input())
btc = 380000.0
a = 0

for _ in range(n):
    x, u = input().split()
    if u == 'JPY':
        a += int(x)
    elif u == 'BTC':
        a += float(x)*btc
print(a)

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

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

money = 0

for k in xu:
    if k[1] == "JPY":
        money += float(k[0])
    else:
        money += float(k[0])*380000

print(money)

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

Solution (Python):
N = int(input())
m = []
for i in range(N):
  x, u = input().split(" ")
  if u == 'JPY':
    m.append(int(x))
  elif u == 'BTC':
    m.append(float(x) * 380000)

print(sum(m))

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    m = [tuple(input().split()) for _ in range(n)]
    btc_to_jpy = 380000
    ans = 0
    for price, kind in m:
        if kind == 'JPY':
            ans += int(price)
        else:
            ans += btc_to_jpy * float(price)
    print(ans)


if __name__ == '__main__':
    main()

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

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, u = input().split()
  if u == 'BTC':
    ans += float(x)*380000
  else:
    ans += int(x)
print(ans)

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

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

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
  ans=ans+x
print(ans)

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

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
  ans=ans+x
print(ans)

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

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

answer = 0
for i in range(N):
    if xu[i][1] == 'JPY':
        answer += int(xu[i][0])
    else:
        answer += float(xu[i][0]) * 380000.0
print(answer)

Solution (Python):



N = int(input())
money = 0

for i in range(N):
    value,money_type = map(str,input().split())
    if money_type == "JPY":
        money += int(value)
    elif money_type == "BTC":
        money += float(value) * 380000
        
print(money)

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

Solution (Python):
N = int(input())
total =0
for i in range(N):
  MM = input().split()
  if MM[-1] == 'JPY':
    total += float(MM[0])
  else:
    total += float(MM[0]) *380000
print(total)

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

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

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

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

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

Solution (Python):
n = int(input())
xu = []
ans = []
for i in range(n):
    XU = list(input().split())
    xu.append(XU)
for m, c in xu:
    if c == "JPY":
        ans.append(int(m))
    else:
        ans.append(float(m)*380000)
print(sum(ans))

Solution (Python):
btc_rate = 380000
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 * btc_rate
    
print(ans)

Solution (Python):



























































def calculation(lines):
    
    N = int(lines[0])
    
    
    
    
    

    result = 0
    for i in range(N):
        line = lines[i+1]
        if 'JPY' in line:
            result += int(line.replace(' JPY', ''))
        else:
            result += float(line.replace(' BTC', ''))*380000.0

    return [result]



def get_input_lines():
    line = input()
    N = int(line)
    lines = list()
    lines.append(line)
    for _ in range(N):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2', '10000 JPY', '0.10000000 BTC']
        lines_export = [48000.0]
    if pattern == 2:
        lines_input = ['3', '100000000 JPY', '100.00000000 BTC', '0.00000001 BTC']
        lines_export = [138000000.0038]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines()
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

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

ans = yt + bt*380000
print(ans)

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

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

s= 0

for i in range(n):
    if l[i][1] == 'JPY':
        s+=float(l[i][0])
    else:
        s+=float(l[i][0])*380000.0
print(s)

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

Solution (Python):

import sys

N = int(input())
en =0
bt =0
for i in range(N):
    a,b =input().split()
    if b =="JPY":
        en +=float(a)
    elif b =="BTC":
        bt +=float(a)
ans =en +bt *380000.0
print(ans)

Solution (Python):
j, b = 0, 0
for _ in range(int(input())):
    m, jb = input().split()
    if jb == "JPY":
        j += int(m)
    else:
        b += float(m)
print(j + 380000 * b)

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

print(float(ans))

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

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

Solution (Python):
N = int(input())
sm = 0
for i in range(N):
    m,c = input().split()
    m = float(m)
    if c == 'JPY':
        sm += m
    else:
        sm += m*380000.0
print(sm)

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

Solution (Python):
def main():
  n = int(input())
  xy = [map(str, input().split()) for _ in range(n)]
  x, u = [list(i) for i in zip(*xy)]
  sum=0
  for i in range(0,n):
    if u[i]=='JPY':
      sum+=float(x[i])
    else:
      sum+=float(x[i])*380000
  print(sum)
  
main()

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

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

ans = 0
for x, u in x_u:
    if u == "JPY":
        ans += float(x)
    else:
        ans += float(x) * 380000.0
print(ans)

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

def main():
    n = int(input())
    xu = [list(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)
        
if __name__ == '__main__':
    main()

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