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

btcjpy = 380000.0
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
xu = [[] for _ in range(N)]
for i in range(N):
    xu[i] = list(input().split())
    xu[i][0] = float(xu[i][0])
for i in xu:
    if i[1] == 'BTC':
        i[0] = i[0]*380000.0
print(sum(x[0] for x in xu))

Submission status: Accepted

Solution code:
import sys
from collections import deque
input = sys.stdin.readline

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

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:
#Coding:Utf-8

N=int(input())
total=0

for i in range(N):
  a,u=map(str,input().split())
  if u=="JPY":
    total=total+float(a)
  else:
    total=total+float(a)*380000

print(total)

Submission status: Accepted

Solution code:
N = int(input())
list = []
for i in range(N):
    a, b = input().split()
    list.append(float(a) if b == "JPY" else float(a) * 380000)
print(sum(list))

Submission status: Accepted

Solution code:
N = int(input())
list = []
for i in range(N):
    a, b = input().split()
    list.append(float(a) if b == "JPY" else float(a) * 380000)
#print(list)
print(sum(list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
money = []
unit = []
for i in range(n):
    m, u = input().split()
    money.append(float(m))
    unit.append(u)

total = 0.0
for m, u in zip(money, unit):
    if u == 'JPY':
        total += m
    else:
        total += 380000.0*m
print(total)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
number = int(input())

input = [input() for i in range(number)]

result = 0

for i in range(number):
	otoshidama = input[i].split()
	if otoshidama[1] == "JPY":
		result = result + float(otoshidama[0])
	elif otoshidama[1] == "BTC":
		result = result + float(otoshidama[0]) * 380000.0

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

money = float(0)

for i in range(N):
    if x[i][1] == 'BTC':
        money += float(x[i][0]) * 380000
    else:
        money += float(x[i][0])

print(money)

Submission status: Accepted

Solution code:


def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

    for i in range(0, N):
        if str(lst[i][1]) == "JPY":
            Y += float(lst[i][0])
        else:
            Y += float(lst[i][0])*380000.0
    print(Y)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

N = int(input())
lst_1 = []
ans = 0

for n in range(N):
    lst_1.append(input().split())

for n in range(N):
    money = 0
    money = float(lst_1[n][0])
    if lst_1[n][1] == "BTC":
        money = money * 380000
    ans += money

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

sum = 0
for _ in range(N):
  x, u = map(str, input().split())
  if u == 'JPY':
    sum += int(x)
  else:
    sum += float(x) * 380000.0

print(sum)

Submission status: Accepted

Solution code:
N = int(input())

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

print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
x=[list(input().split()) for _ in range(N)]
ans = 0
for  value, many_type in x:
	if many_type == 'JPY':
		ans += float(value)
	else:
		ans += float(value)*380000

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
xus = []
for _ in range(N):
    xus.append([e for e in input().split(" ")])

cum = 0.0
for x, u in xus:
    x = float(x)
    if u == "JPY":
        cum = cum + x
    else:
        cum = cum + 380000.0 * x
print(cum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
n=int(input())

sum=0

for i in range(n):
  a,b=map(str, input().split())
  A=float(a)
  if b=="BTC":
    k=A*380000
  else:
    k=A
  sum+=k
print(float(sum))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(sum(x[0] for x in xu))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def main():
    btc_coeff = 380000
    ans = 0
    for _ in range(N):
        x, u = [s for s in input().split()]
        if u == 'JPY':
            ans += float(x)
        elif u == 'BTC':
            ans += float(x) * btc_coeff
    print(ans)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

    if u == 'JPY':
        total += int(x)
    else:
        total += float(x) * 38e4

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

print(A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
total = 0
for i in range(n):
    x,u = input().split()
    if u == "BTC":
        x = float(x) * 380000.0
    total += float(x)
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())
x = [0]*N
u = [0]*N
for n in range(N):
    a = list(input().split())
    x[n] = float(a[0])
    u[n] = a[1]
S = 0
    
for n in range(N):
    if u[n] == 'JPY':
        S += x[n]
    elif u[n] == 'BTC':
        S += x[n] * 380000.

print(S)

Submission status: Accepted

Solution code:
N = int(input())
x = 0
u = 0
Y = 0
for i in range(N):
    str = input().split(' ')

    x = float(str[0])
    u = str[1]
    if u == 'JPY':
        Y += x
    else:
        Y += x * 380000.0
print(Y)

Submission status: Accepted

Solution code:
n = int(input())

x = []
u = []

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

ans = 0.0
for i in range(n):
    if u[i] == "JPY":
        ans += float(x[i])
    else:
        ans += float(x[i]) * 380000.0

print(ans)

Submission status: Accepted

Solution code:
print(sum(38e4**('B'in s)*float('0'+s[:-4])for s in open(0)))

Submission status: Accepted

Solution code:
from sys import stdin
from decimal import *
N = int(stdin.readline().rstrip())
sp = [stdin.readline().split() for i in range(N)]
# print(sp)
sum = Decimal(0)
bitcoin = Decimal(380000.0)
for i in range(N):
    sp[i][0] = Decimal(sp[i][0])
    # print(sp[i][0])
    if sp[i][1] == 'JPY':
        sum += sp[i][0]
    else:
        sum += sp[i][0] * bitcoin
print(sum)

Submission status: Accepted

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


def solve(N: int, X: "List[float]", U: "List[str]"):
    money = 0

    for x,u in zip(X,U):
        xx = x
        if u == "BTC":
            xx = x*380000.0

        money += xx
    
    print(money)



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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)
    solve(N, x, u)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
i=0
j=0
L=[]
cnt=0
while i<N:
     l=list(input().split())
     L.append(l)
     i+=1
while j<N:
     if L[j][1]=="JPY":
          cnt+=int(L[j][0])
     else:
          cnt+=float(L[j][0])*380000.0
     j+=1
print(cnt)

Submission status: Accepted

Solution code:
a = int(input())

btc = 0
yen = 0

for i in range(a):
    a = input().split()
    if a[1] == 'BTC':
        btc += float(a[0])
    else:
        yen += int(a[0])

btc = btc * 380000

print(float(btc + yen))

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

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

    if v == 'JPY':
        sum_charge += x
    else:
        sum_charge += (x*380000.0)

print('{:.11f}'.format(sum_charge))

Submission status: Accepted

Solution code:
n = int(input())
ans = 0.0
for _ in range(n):
  p, type = input().split()
  if(type == 'JPY'):
    ans += int(p)
  else:
    ans += float(p) * 380000.0
print(ans)

Submission status: Accepted

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

print(amnt)

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}
# b = list(map(lambda x: math.ceil(x/10)*10, a))


N = int(input())

sum = 0
for _ 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:
sum = 0
bit = 0
N = int(input())

for i in range(N):
    x , u = map(str , input().split(" "))

    if u == "JPY":
        sum = sum + int(x)
    elif u == "BTC":
        bit = 380000 * (float(x) / 1.0)
        sum = sum + bit

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
xu = [list(input().split()) for _ in range(n)]
btc = 380000.0
ans = float(0)

for i in range(n):
    count = 0
    if xu[i][1] == 'JPY':
        ans += int(xu[i][0])
    else:
        ans += btc * float(xu[i][0])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(sum)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
ans = 0

for i in range(n):
    x, y = input().split()
    x = float(x)

    if y == 'JPY':
        ans += x
    else:
        ans += x * 380000
print(ans)

Submission status: Accepted

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

res = 0

for i in _list:
    if i[1] == 'JPY':
        res += int(i[0])
    else:
        res += float(i[0]) * 380000

print(res)

Submission status: Accepted

Solution code:
N = int(input())
money = []
oko = 0
for i in range(N):
  money.append(input().split(" "))
  if money[i][1] == "JPY":
    oko += float(money[i][0])
  elif money[i][1] == "BTC":
    oko += (float(money[i][0]) * 380000.0)
  
print(oko)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
JPY = "JPY"
RATE = 380000
N = int(input())
my_list = []
for i in range(N):
    s = input()
    my_list.append((float(s.split()[0]), s.split()[1]))

# for i in range(N):
#     print("[{}] [{}] [{}]".format(i, my_list[i][0], my_list[i][1]))
ret = 0
for i in range(len(my_list)):
    if my_list[i][1] == JPY:
        ret += my_list[i][0]
    else:
        ret += my_list[i][0] * RATE
print(ret)

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

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

print(ans)

Submission status: Accepted

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

# n = 2
# e = [['10000', 'JPY'], ['0.10000000', 'BTC']]

money = {'JPY': 1, 'BTC': 380000}

yen = 0
for row in e:
    yen += float(row[0]) * money[row[1]]

print(yen)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 21:41:22 2019

@author: avina
"""


d = 380000.0 
sums = 0
n = int(input())
for i in range(n):
  a,b = input().strip().split()
  if b == 'JPY':
    sums += float(a)
  else:
    sums += d*float(a)
print(sums)

Submission status: Accepted

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

jpy = 0.0
btc = 0.0
rating = 380000.0
sum = 0.0

for i in range(0, N):
    if otoshidama[i][1] == "JPY":
        jpy += float(otoshidama[i][0])
    else:
        btc += float(otoshidama[i][0])

sum = jpy + btc * rating

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = int(input())
L = [input().strip().split() for _ in range(N)]

s = 0
for v in L:
    if v[1] == "JPY":
        s += int(v[0])
    else:
        s += float(v[0]) * 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
  else:
    ans += 380000*x
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
money = []
tuka = []
for i in range(n):
    li = input().split()
    money.append(float(li[0]))
    tuka.append(li[1])

ans = 0
for j in range(n):
    if tuka[j] == "JPY":
        ans += money[j]
    else:
        ans += 380000 * money[j]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a, b = [], []
for i in range(N):
    s, t = input().split()
    s = float(s)
    a.append(s)
    b.append(t)

ans = 0
for i in range(N):
    if b[i] == 'JPY':
        ans += a[i]
    else:
        ans += 380000.0 * a[i]
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    N = int(stdin.readline().rstrip())
    xus = [stdin.readline().rstrip().split() for _ in range(N)]
    xs = [int(x) if u == 'JPY' else float(x) * 380000 for x, u in xus]
    print(sum(xs))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Digital Gifts
# abc119_b
N=int(input())
sum=0
btc=380000
for _ in range(N):
 x, u=input().split()
 x=float(x)
 if u=="BTC":
  sum=sum+btc*x
 else:
  sum=sum+x
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
X = []; U = []; JPY = []; BTC = []
for i in range(n):
    x, u = input().split()
    X.append(x); U.append(u)
for i in range(n):
    if U[i] == "JPY":
        JPY.append(float(X[i]))
    else:
        BTC.append(float(X[i]))
print(sum(JPY) + sum(BTC)*380000)

Submission status: Accepted

Solution code:
N = int(input())
x=[]
u=[]
for i in range(0,N):
    a=[j for j in input().split()]
    x.append(float(a[0]))
    u.append(a[1])

s=0
for i in range(0,N):
    if u[i]=="BTC":
        s+=380000*x[i]
    else:
        s+=x[i]
print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
y_l = []
b_l = []
for i in range(n):
    x, u = input().split()
    if u == 'JPY':
        y_l.append(float(x))
    else:
        b_l.append(float(x))

total = sum(y_l) + (sum(b_l) * 380000)
print(total)

Submission status: Accepted

Solution code:
N = int(input())

sum_otoshidama_jpy = 0.0
for i in range(N):
    x, u = input().split()
    if u == 'JPY':
        sum_otoshidama_jpy += float(x)
    else:
        sum_otoshidama_jpy += float(x) * 380000

print(sum_otoshidama_jpy)

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)
money=0
for k in range(N):
    if U[k]=='JPY':
        money=money+X[k]
    else:
        money=money+X[k]*380000.0
print(money)

Submission status: Accepted

Solution code:
n=int(input())
x=[input().split() for _ in range(n)]
print(sum([float(x[i][0])*[1,380000][x[i][1]=="BTC"] for i in range(n)]))

Submission status: Accepted

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

print(dama)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
def money(A):
    if A[1]=="JPY":
      return float(A[0])
    else:
      return float(A[0])*380000.0
A = [money(input().split()) for _ in range(N)]
print(sum(A))

Submission status: Accepted

Solution code:
import math
from decimal import *
n = int(input())

total = Decimal('0')

for i in range(n):
  x, u = map(str, input().split())
  if u == 'BTC':
    x = Decimal(Decimal(x)) * Decimal(380000.0)
  total += Decimal(x)

print(round(total, 4))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S=[]
for i in range(N):
    A=list(input().split())
    #print(A)
    if A[1]=="JPY":
        S.append(int(A[0]))
    elif A[1]=="BTC":
        S.append(float(A[0])*380000)
print(sum(S))

Submission status: Accepted

Solution code:
n = int(input())
x = [input().split() for _ in range(n)]
y = 0
for i in x:
  if i[1] == 'JPY':
    y += int(i[0])
  else:
    y += float(i[0]) * 380000.0

print(y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0.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())
money = 0
for i in range(N):
    x, u = input().split()
    if u == 'JPY':
        money += float(x)
    else:
        money += float(x) * 380000.0
print("{}".format(money))

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
  a=input()
  if a[-3:]=='BTC':
    b=float(a[:-4])*380000.0
  else:
    b=float(a[:-4])
  l.append(b)
print(sum(l))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = int(input())
d = {'JPY':1, 'BTC':380000.0}
X = [None] * N
U = [None] * N

for i in range(N):
    X[i], U[i] = input().split()

print(sum(float(x) * d[u] for x, u in zip(X, U)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

x = []
for i in range(N):
    x.append([j for j in input().split()])

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

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
x = [0] * n
u = ['string'] * n
for j in range(n):
    x[j], u[j] = input().split()
for j in range(n):
    if u[j] == 'JPY':
        x[j] = int(x[j])
    elif u[j] == 'BTC':
        x[j] = float(x[j]) * 380000
print(np.sum(x))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())

    xu_list = [list(map(str, input().split())) for i in range(N)]

    answer = 0
    for xu in xu_list:
        if xu[1] == 'JPY':
            answer += int(xu[0])
        elif xu[1] == 'BTC':
            answer += float(xu[0]) * 380000.0

    print(answer)

Submission status: Accepted

Solution code:
N = int(input())
total=float(0)

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

Submission status: Accepted

Solution code:
N = int(input())

yen = 0
bit = 0
for i in range(N):
    n = input().split()
    x = float(n[0])
    if n[1] == 'JPY':
        yen += x
    else:
        bit += x*380000

print(yen+bit)