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.



Sample input:
2
10000 JPY
0.10000000 BTC


Sample output:
48000.0

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import Decimal

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(N):
    x,u = list(input().split())
    if u == 'JPY':
        ans += float(x)
    else:
        ans += float(x)*3.8*10**5
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

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

print(sum(mass))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
n = int(raw_input())
q= 0 
for _ in range(n):
	u,v = raw_input().split(' ')
	u = float(u)
	h = {'BTC':380000.0, 'JPY':1.0}
	q += u * h[v]
print q

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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



if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [float()] * (N)  # type: "List[float]"
    u = [str()] * (N)  # type: "List[str]"
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    print(solve(N, x, u))

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

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
n = int(input())
apple = []
for _ in range(n):
    apple.append(list(map(str, input().split())))
count = 0
for i in apple:
    if i[1] == "JPY":
        count += int(i[0])
    else:
        count += 38e4 * float(i[0])
print(count)

Submission status: Accepted

Solution code:
# B
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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


def main():

    N = in_n()

    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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)

Submission status: Accepted

Solution code:
n=int(input())
y=[]
t=[]
l=[]
for i in range(n):
    x,u=input().split()
    y.append(float(x))
    t.append(u)
for i in range(n):
    if t[i]=='JPY':
        l.append(y[i])
    else:
        l.append(y[i]*380000.0)
print(sum(l))

Submission status: Accepted

Solution code:
N = int(input())

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

ans = 0

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

Submission status: Accepted

Solution code:
from decimal import *

import numpy as np

import math

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

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

    print(count)

Submission status: Accepted

Solution code:
n = int(input())
a = [ list(input().split()) for _ in range(n) ]
#a = [['10','JPY'],['0.00001','BTC']]

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

print(yen + btc * 380000)

Submission status: Accepted

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

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

    print(s)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(N):
  a,b = input().split()
  a = float(a)
  if b == "JPY":
    ans += a
  else:
    ans += f*a
print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
n = int(input())

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

print(total)

Submission status: Accepted

Solution code:
def actual(n, X, U):
    # 変換: 1[BTC] == 380000.0[円]
    amount_yen = 0

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

    return amount_yen

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
n=int(input())
ans=0
for i in range(n):
    x,u=input().split()
    if u=="BTC":
        x=float(x)
        ans+=380000*x
    else:
        x=int(x)
        ans+=x
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import Counter
import itertools
import fractions
import datetime
from decimal import Decimal
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

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

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

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

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

Submission status: Accepted

Solution code:
import decimal

n = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

n = int(input())

bit = 380000

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0.0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

xu = [0]*n

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
C = 380000.0

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n=int(input())

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

    x= float(x)

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

total += btc*380000

print(total)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
"""
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# input
N = int(input())

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

print(otoshidama)

Submission status: Accepted

Solution code:

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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)