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())
x = []
u = []

for i in range(n):
    temp1, temp2 = input().split()
    x.append(float(temp1))
    u.append(temp2)

total = 0

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

print(total)

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

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)
    if u == 'BTC':
        ans += float(x) * 380000.0
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

count = 0
for i in range(N):
    x, u = input().split()
    x = float(x)

    if u == 'JPY':
        count += x
    else:
        count += (x * 380000)


print(count)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

money = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(total)

Submission status: Accepted

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

print(s)

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
total = 0
for i in range(N):
    x,y = input().split()
    if y == "JPY":
        total += int(x)
    elif y == "BTC":
        total += float(x)*380000
print(total)

Submission status: Accepted

Solution code:
n =int(input())
x = [0]*n
u = [0]*n
a = 0

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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



print(answer)

Submission status: Accepted

Solution code:
n=int(input())
an=0

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

print(an)

Submission status: Accepted

Solution code:
n = int(input())

x = []
sum = 0

for i in range(n):
    x.append(list(input().split()))

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

otoshi = [list(input().split()) for _ in range(n)]

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

print(money)

Submission status: Accepted

Solution code:
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    l = [list(list(sys.stdin.readline().split())) for i in range(n)]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
xu=[]
for i in range(n):
    xu.append(list(map(str,input().split())))
yen=0
for i in range(n):
    if xu[i][1]=='JPY':
        yen+=int(xu[i][0])
    else:
        yen+=float(xu[i][0])*380000
print(yen)

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+=380000*float(a)
print(c)

Submission status: Accepted

Solution code:
# ABC 119, B - digital gift

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

    if u == "BTC":
        total += x*380000
    if u == "JPY":
        total += x

print(total)

Submission status: Accepted

Solution code:
N = int(input())
cost = [list(input().split()) for i in range(N)]
count = 0

for i in range(N):
  if cost[i][1] == "JPY":
    count += float(cost[i][0])
  else:
    count += float(cost[i][0]) * 380000.0
    
print(count)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
total = 0
for i in range(n):
    r = input().split(" ")
    if r[1] == "JPY":
        total += float(r[0])
    else:
        total += float(r[0])*380000
print(total)

Submission status: Accepted

Solution code:
num = int(input())
str_in = [input() for i in range(num)]

sum = 0.0

for i in range(num):
  tmp   = str_in[i].split()
  value = float(tmp[0])
  unit  = tmp[1]
  
  if(unit == 'BTC'):
    sum += value * 380000.0
  else:
    sum += value
    
print (sum)

Submission status: Accepted

Solution code:
n=int(input())
lst=[input().split() for _ in range(n)]
lst_j=[]
for i in lst:
    if i[1]=='JPY':
        lst_j.append(int(i[0]))
    elif i[1]=='BTC':
        lst_j.append(float(i[0])*380000)
print(sum(lst_j))

Submission status: Accepted

Solution code:

n=int(input())
s=[input().split() for _ in range(n)]
res = 0.0
for v, c in s:
    v = float(v)
    v = v if c == 'JPY' else v * 380000.0
    res += v
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res=0

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

print(res)

Submission status: Accepted

Solution code:
N=int(input())
ans=0
for i in range(N):
  x=list(input().split())
  x[0]=float(x[0])
  if x[1]=='JPY':
    ans+=x[0]
  elif x[1]=='BTC':
    ans+=380000.0*x[0]
    
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 += float(x)
    else:
        sum += 380000. * float(x)

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

sum = 0.0

for i in range(N):
    S = input()
    S = S.split()

    x = float(S[0])
    u = S[1]

    if u == "JPY":
        sum = sum + x
    else:
        sum = sum + x * 380000

print(sum)

Submission status: Accepted

Solution code:
n  = int(input())
a = []
total = 0
for _ in range(n):
    a.append(input().strip().split())
for i in range(n):
    b = a[i]
    price = float(b[0])
    name = str(b[1])
    if name == "JPY":
        total += price
    else:
        total += price * 380000
print(total)

Submission status: Accepted

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

print(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
X = [0] * N
U = [0] * N
for i in range(N):
  X[i], U[i] = input().split()
  X[i] = float(X[i])
  if U[i] == 'BTC':
    X[i] = X[i] * 380000.0
print(sum(X))

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = []
y = []
sum = 0
for i in range(n):
    a,b = map(str,input().split())
    x.append(float(a))
    y.append(b)
for i in range(n):
    if y[i] == "BTC":
        sum += x[i] * 380000
    else:
        sum += x[i]
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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.0
print(sum)

Submission status: Accepted

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

otoshidama = 0
for i in range(N):
	x[i][0] = float(x[i][0])
	if x[i][1] == "BTC":
		x[i][0] = x[i][0] * 380000.0
	otoshidama += x[i][0]

print(otoshidama)

Submission status: Accepted

Solution code:


def main():
    N = int(input())
    ans = 0.0
    Rate = 380000.0
    for  i in range(N):
        otosidama, otype = input().split()
        otosidama = float(otosidama)
        if otype == "JPY":
            ans +=otosidama
        else:
            ans += otosidama*Rate
    
    print(ans)










if __name__== "__main__":
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
s=0
for i in range(N):
    x=input()
    s+=float(x[:-4])*(1.0+(x[-1]=='C')*380000.0)
print(s)

Submission status: Accepted

Solution code:
#ABC119b

n=int(input())
xlist=[0 for i in range(n)]
ulist=[0 for i in range(n)]
answer=0

for i in range(n):
	xlist[i],ulist[i]=input().split()
	if ulist[i]=="JPY":
		answer+=float(xlist[i])
	else:
		answer+=380000*float(xlist[i])

print(answer)

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    result_yen = 0.0
    for _ in range(N):
        x,u = [s for s in input().split() if s]
        coeff = 380000.0 if u == 'BTC' else 1.0
        result_yen += float(x)*coeff
    
    print(result_yen)
    
solve()

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 += (380000 * float(x))

print(ans)

Submission status: Accepted

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

for i in range(N):
        S = input().split()
        x = float(S[0])
        u = S[1]

        if S[1] == 'BTC':
                x *= 380000
        
        sum += x

print(round(sum,5))

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

print('{:.8f}'.format(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = 0
for i in range(n):
    a, b = input().split(" ")
    a = float(a)
    s += a * {"JPY": 1, "BTC": 380000}[b]
print(s)

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    BTC_TO_YEN = 380000.0
    result = 0.0
    otoshidama = [i.split() for i in inputs]
    for o in otoshidama:
        if o[1] == "BTC":
            result += float(o[0]) * BTC_TO_YEN
        else:
            result += float(o[0])
    return result


def string_to_float(string):
    return list(map(lambda x: float(x), string.split()))


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N))
    print(ret)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
def main():

    """ convenient functions
    # for i, a in enumerate(iterable)
    # q, mod = divmod(a, b)
    # divmod(x, y) returns the tuple (x//y, x%y)
    # Higher-order function: reduce(operator.mul, xyz_count, 1)
    # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f
    """

    """convenient decorator
    # @functools.lru_cache():
    # to facilitate use of recursive function
        # ex:
        # from functools import lru_cache
        # import sys
        # sys.setrecursionlimit(10**9)
        # @lru_cache(maxsize=None)
        # def fib(n):
        #     if n < 2:
        #         return n
        #     return fib(n-1) + fib(n-2)
        # print(fib(1000))
    """
    
    # import numpy as np
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html
    # accumulate() returns iterator! to get list: list(accumulate())
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  # prime factor
        b, e = 2, 0  # base, exponent
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        # TODO: How should I do when n - r is negative?
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html
    from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html
    import operator
    from operator import itemgetter
    # ex1: List.sort(key=itemgetter(1))
    # ex2: sorted(tuples, key=itemgetter(1,2))
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    # first create factorial_list
    # fac_list = mod_factorial_list(n)
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!
    def modinv(a, p = MOD):
        # evaluate reciprocal using Fermat's little theorem:
        # a**(p-1) is identical to 1 (mod p) when a and p is coprime
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        # fac_list = modfactorial_list(100)
        # print(modcomb(100, 5, modfactorial_list(100)))
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    """ initialize variables and set inputs
    # initialize variables
        # to initialize list, use [0] * n
        # to initialize two dimentional array, use [[0] * N for _ in range(N)]
    # set inputs
        # open(0).read() is a convenient method:
        # ex) n, m, *x = map(int, open(0).read().split())
        #     min(x[::2]) - max(x[1::2])
        # ex2) *x, = map(int, open(0).read().split())
        #     don't forget to add comma after *x if only one variable is used
    # preprocessing
        # transpose = [x for x in zip(*data)]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
        # flat = [flatten for inner in data for flatten in inner]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]
    # calculate and output
        # output pattern
        # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6
    """

    # functions used
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    # single int: int(r())
    # single string: r()
    # single float: float(r())
    # line int: R()
    # line string: r().split()
    # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]
    # lines int: [R() for _ in range(n)]
    """

    if __name__ != '__main__':
        # for test
        sys.stdin = open('sample.txt')

    # ----------------------------------
    # main

    N = int(r())
    ans = 0
    for _ in range(N):
        x, u = r().split()
        if u == "BTC":
            ans = ans + float(x) * 380000
        else:
            ans += float(x)
    print(ans)
    
    # end of main
    # ----------------------------------

    """memo: how to use defaultdict of list
    # initialize
    Dic = defaultdict(list)
    # append / extend
    Dic[x].append(y)
    # for
    for k, v in Dic.items():
    """

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

total = 0
for i in xu:
  if i[1]=='BTC':
    total += 380000 * float(i[0])
  else:
    total += int(i[0])
print(total)

Submission status: Accepted

Solution code:
N = int(input())
Y = 0
for i in range(0, N):
	inpt = input().split()
	if inpt[1] == 'JPY':
		Y += float(inpt[0])
	else:
		Y += float(inpt[0])*380000
print(Y)

Submission status: Accepted

Solution code:
N = int(input())
#0:金額 1:種類
Money = [[] for _ in range(N)]
for i in range(N):
    Money[i] = input().split()

cnt = 0
for i in range(N):
    if Money[i][1] == "JPY":
        cnt += int(Money[i][0])
    else:
        cnt += float(Money[i][0]) * 380000.0

print(cnt)

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 += (x * 380000)

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
info=[]
for i in range(n):
    info.append(list(input().split()))                
total=0

for i in range(n):
    if info[i][1]=="JPY":
        total+=eval(info[i][0])
    else:
        total+=(eval(info[i][0])/0.00000001)*0.0038
print(total)

Submission status: Accepted

Solution code:
N = int(input())
c = 0
for i in range(N):
 a = list(input().split())
 if a[1] == 'BTC':
  c += float(a[0])*380000.0
 else:
  c += float(a[0])
print(c)

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
    elif u == 'BTC':
        ans += x * 380000
print(ans)