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:
import sys


def solution(nominals, currency):
    result = 0
    for value, c in zip(nominals, currency):
        if c =="JPY":
            result += value
        else:
            result += 380000.0 * value
    return result



nominals, currencies = [], []
for i,line in enumerate(sys.stdin):
    if i == 0:
        cases = int(line)
    else:
        n, c = line.split(' ')
        nominals.append(float(n))
        currencies.append(c.strip())

print(solution(nominals, currencies))

# print(solution([10000, 0.1], ['JPY', 'BTC']))
# print(solution([100000000 , 100.00000000, 0.00000001 ], ['JPY', 'BTC', 'BTC']))

Submission status: Accepted

Solution code:
n=int(input())

otoshidama=0.0
for i in range(n):
    inp=input().strip().split()
    x=float(inp[0])
    u=inp[1]
    if u=="JPY":
        otoshidama+=x
    elif u=="BTC":
        otoshidama+=x*380000.0
print(otoshidama)

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))

list = [list(input().split()) for i in range(n[0])]

yen = 0
btc = 380000
for row in list:
    if row[1] == 'JPY':
        yen += int(row[0])
    else:
        yen += float(row[0]) * btc

print(yen)

Submission status: Accepted

Solution code:
# coding=utf-8

if __name__ == '__main__':

    N = int(input())
    otsdm = 0

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

        if x[1] == 'JPY':
            otsdm = otsdm + float(x[0])
        else:
            otsdm = otsdm + float(x[0]) * 380000

    print(otsdm)

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
    else:
        total += x * 380000.0

print(total)

Submission status: Accepted

Solution code:
sum41 = 0
n = int(input())
for _ in range(n):
	tmp = input().split(' ')
	sum41 += float(tmp[0]) if tmp[1] == 'JPY' else float(tmp[0]) * 380000

print(1.0 * sum41)

Submission status: Accepted

Solution code:
n = int(input())
 
li = []
for i in range(n):
    li.append(list(input().split()))
 
 
for money in li:
    if money[1] == 'JPY':
        continue
    else:
        money[0] = float(money[0]) * 380000.0
 
sum_money = sum([float(i[0]) for i in li])
  
print(sum_money)

Submission status: Accepted

Solution code:
N = input().rstrip()
money = [input().rstrip().split(" ") for i in range(int(N))]
total = 0.0

for i in range(int(N)):
    if str(money[i][1]) == "BTC":
        total += float(money[i][0])*380000.0
    else:
        total += float(money[i][0])
print(total)

Submission status: Accepted

Solution code:
N = int(input())
a = []
sum = 0
for i in range(N):
    a.append(list(map(str, input().split())))
for i in range(N):
    if a[i][1] == "BTC":
        a[i][0] = 380000 * float(a[i][0])
    sum = sum + float(a[i][0])
print(sum)

Submission status: Accepted

Solution code:
import sys
s=0;input()
for e in sys.stdin:
 a,b=e.split()
 s+=int(a) if b=="JPY"else float(a)*380000
print(s)

Submission status: Accepted

Solution code:

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = []
sum = 0

for i in range(n):
    s.append(list(map(str,input().split())))
for i in range(n):
    s[i][0] = float(s[i][0])
for i in range(n):
    if s[i][1] == 'JPY':
        sum += s[i][0]
    elif s[i][1] == 'BTC':
        sum = sum + s[i][0] * 380000

print (sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
btc=380000
N=int(input())
number=[0]*N
string=[0]*N
for i in range(N):
    list=input().split()
    number[i]=float(list[0])
    string[i]=list[1]

sum=0
for i in range(N):
    if string[i]=="JPY":
        sum=sum+number[i]
    else:
        sum=sum+number[i]*btc
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
d = list([input().split() for i in range(n)])
y = 0
JPY = 0
BTC = 0
c = [0] * n

for i in range(n):
    if d[i][1] == 'BTC':
        c[i]= float(d[i][0])
        BTC += c[i] * 380000
    else:
        c[i]= int(d[i][0])
        JPY += c[i]
y = BTC + JPY
print(y)

Submission status: Accepted

Solution code:
BTC = 380000

N = int(input())
sum_otoshidama = 0

for n in range(N):
    otoshidama = input().split()
    if otoshidama[1] == 'BTC':
        sum_otoshidama += float(otoshidama[0])*BTC
    else:
        sum_otoshidama += float(otoshidama[0])

print(sum_otoshidama)

Submission status: Accepted

Solution code:
n = int(input())
sum = 0.0
box = []
a = []
b = []
for num in range(n):
  box = input().split(" ")
  a.append(box[0])
  b.append(box[1])
  if b[num] == "JPY":
    sum += float(a[num])
  else:
    sum += (float(a[num]) * 380000.0)

print(sum)

Submission status: Accepted

Solution code:
sum = 0

num = int(input())

for i in range(num) :
    money, currency = input().split()
    money = float(money)
    if currency == 'JPY' :
        sum += money
    else :
        sum += money * 380000

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
otoshidama = []
otoshidama_sum = 0
for i in range(N):
    otoshidama.append(input().split())
for i in range(N):
    otoshidama[i][0] = float(otoshidama[i][0])
    if otoshidama[i][1] == 'BTC':
        otoshidama[i][0] = otoshidama[i][0]*380000
    otoshidama_sum += otoshidama[i][0]
print(otoshidama_sum)

Submission status: Accepted

Solution code:
n = int(input())
sum = 0.00
for i in range(n):
	price,format = input().strip().split(' ')
	price = float(price)
	if format == "BTC":
		price *= 380000
	sum += price
print(sum)

Submission status: Accepted

Solution code:
n = int(input())

sum = 0.0
for _ in range(n):
	data = input().split()
	if data[1] == "JPY":
		sum += int(data[0])
	elif data[1] == "BTC":
		sum += float(data[0]) * 380000.0
		
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c=0
for _ in[0]*int(input()):s=input();n=float(s[:-3]);c+=n*((s[-3:]>'C')or 380000)
print(c)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

def parse_input(lines_as_string = None):

    lines = []
    if lines_as_string is None:
        lines.append(input())
        # 出力
        nm = lines[0].split(" ")
        n = int(nm[0])
        for i in range(n):
            lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]
        nm = lines[0].split(" ")
        n = int(nm[0])

    rows = []
    for i in range(1, n+1):
        fields = lines[i].split(" ")
        rows.append((float(fields[0]), fields[1]))

    return (n, rows)

def solve(n, rows):

    result = 0.0
    for i in range(n):

        money = rows[i][0]
        unit = rows[i][1]
        k = 1
        if unit == 'BTC':
             k = 380000.0

        result += k * money


    return result

def main():

    print("%f" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
x=0
for i in range(N):
    a,b=map(str,input().split())
    a=float(a)
    if b=='BTC':
        a*=380000.0
    x+=a
print(x)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
ans = 0
for i in range(N):
    a = []
    a = input().split(" ")
    y = float(a[0])
    
    if a[1]=="BTC":
        k =y*380000
        ans +=k
    else:
        ans +=y
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    count = 0.0
    for _ in range(N):
        x, u = input().split()
        if u == 'JPY':
            count += int(x)
        else:
            count += float(x)*380000
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(Y)

Submission status: Accepted

Solution code:
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    x[i],u[i] = map(str, input().split())
    x[i] = float(x[i])

sum = 0

for i in range(N):
    if (u[i] == 'JPY'):
        sum += x[i]
    elif (u[i] == 'BTC'):
        sum += x[i] * 380000
    else:
        break
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

xu_list = []
for i in range(N):
    if xu[i][1] == "JPY":
        xu_list.append(float(xu[i][0]))
    elif xu[i][1] == "BTC":
        xu_list.append(float(xu[i][0])*380000.0)

print(sum(xu_list))

Submission status: Accepted

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

print(Otoshidama)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
sum = 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())
X = []
U = []
for i in range(N):
    l = list(map(str, input().split()))
    U.append(l[1])
    if U[i] == 'JPY':
        X.append(int(l[0]))
    else:
        X.append(float(l[0]))

Y = 0.0
for n in range(N):
    if U[n]=='JPY':
        Y += X[n]
    else:
        Y += X[n] * 380000.0

print(Y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c=0
for _ in[0]*int(input()):s=input();n=float(s[:-3]);c+=n*380000*(s[-3:]<'J')or n
print(c)

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline().rstrip())

sum = 0
for i in range(n):
  line = sys.stdin.readline().rstrip().split(" ")
  if(line[1] == "BTC"):
    sum += float(line[0]) * 380000.0
  else:
    sum += float(line[0])
print(sum)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    sum = 0
    for _ in range(0, n):
        x, y = (j for j in input().split())
        if(y[0] == 'B'):
            sum += float(x)*380000
        else:
            sum += int(x)
    print(sum)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

    if u[i] == 'BTC':
        Y += x[i]*380000
    else:
        Y += x[i]

print(Y)

Submission status: Accepted

Solution code:
"""AtCoder"""

N = int(input())
xu = [list(input().split()) for _ in range(N)]

ans = 0

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

print(ans)

Submission status: Accepted

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

for _ in range(n):
    a = list(map(str, input().split()))
    if a[1] == "JPY":
        ans += float(a[0])
    else:
        ans += float(a[0]) * 380000

print(float(ans))

Submission status: Accepted

Solution code:
import sys

lines = sys.stdin.readlines()
N = int(lines[0])
XU = [n.split() for n in lines[1:]]

JPN = []
BTC = []
for xu in XU:
  if 'JPY' == xu[1]:
    JPN.append(float(xu[0]))
  else:
    BTC.append(float(xu[0]))

print(sum(JPN) + sum(BTC) * 380000.0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
def main():
    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
    print(sum)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

Solution code:
n=int(input())
otosidama=0
for i in range(n):
  m = list(input().split())
  okane=float(m[0])
  if(m[1]=="BTC"):
    okane=okane*380000.0
  otosidama=otosidama+okane
print(otosidama)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
EBTC = 380000.0
R = 0
for i in range(N):
    t = [x for x in input().split()]
    R = R + float(t[0]) if t[1]=="JPY" else R + float(t[0])*EBTC
print(R)

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:
    x1 = 380000*x
    sum += x1
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
board = [input().split() for _ in range(n)]
base = 380000
result = 0

for xu in board:
  x,u = xu
  if u == 'BTC':
    result += base*float(x)
  else:
    result += int(x)

print(result)

Submission status: Accepted

Solution code:
N = input()
N = int(N)
x = []
v = []
Y = 0
for i in range(N):
    X,V = input().split()
    x.append(X)
    v.append(V)
for i in range(N):
    if v[i] == 'JPY':
        Y += int(x[i])
    elif v[i] == 'BTC':
        Y += 380000.0 * float(x[i])
print(Y)

Submission status: Accepted

Solution code:
import re
otoshidama = 0

N = int(input())

for i in range(0,N):
  ni = re.split('\s+', input())
  if(ni[1] == 'BTC'):
    otoshidama += (float(ni[0]) * 380000.00)
  else:
    otoshidama += int(ni[0])
  
print(otoshidama)

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(n):
	a=list(map(str,input().split()))
	l.append(a)

x=[]
y=[]
for i in range(n):
	x.append(float(l[i][0]))
	y.append(l[i][1])
count_j=0
count_b=0
for i in range(n):
	if(y[i]=="JPY"):
		count_j+=x[i]
	elif(y[i]=="BTC"):
		count_b+=380000*x[i]

ans=count_j+count_b
print(ans)

Submission status: Accepted

Solution code:
"""
B - Digital Gifts
"""
import datetime

if __name__ == '__main__':
    btcrate = 380000
    result = 0
    n = int(input())
    for i in range(n):
        x,u = input().split(' ')
        if(u == 'JPY'):
            result += float(x)
        else:
            result += float(x) * btcrate
    
    print(result)

Submission status: Accepted

Solution code:

# coding: utf-8

# In[32]:


n = int(input())
data = []
for i in range(n):
    x,u = map(str, input().split())
    data.append([x, u, i])


# In[34]:


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


# In[35]:


print(result)

Submission status: Accepted

Solution code:
#coding:utf-8
N = int(input())

xu = []
for i in range(0, N):
    data = list(map(str, input().split()))
    xu.append(data)

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

money = []
for i in range(0, N):
    money.append(xu[i][0])

print(sum(money))

Submission status: Accepted

Solution code:
N=int(input())
x=[]
u=[]
s=0
for i in range(N):
    A,B=input().split()
    x.append(float(A))
    u.append(B)
for i in range(N):
    a=x[i]
    if u[i]=='JPY':
        s+=a
    else:
        s+=a*380000
print(s)

Submission status: Accepted

Solution code:
def main() -> None:
    N = int(input())
    yen = 0
    for _ in range(N):
        x, u = input().split()
        if u == 'JPY':
            yen = yen + int(x)
        elif u == 'BTC':
            yen = yen + (float(x) * 380000.0)

    print(yen)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from decimal import Decimal

def solve():
	n = int(input())

	sum = Decimal("0")
	for i in range(n):
		amount, type = input().split()
		if type == "JPY":
			sum += Decimal(amount)
		else:
			sum += Decimal(amount)*Decimal("380000.0")
	return sum
	
	
print(solve())

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
res = 0

for i in range(N):
    inp = input().split(' ')
    xi = float(inp[0])
    ui = inp[1]
    
    if ui == 'JPY':
        res += xi
    else:
        res += xi * 380000

print(res)

Submission status: Accepted

Solution code:
n = int(input())
xn = [input().split() for i in range(n)]
s = 0
for x in xn:
    if x[1] == "JPY":
        s += float(x[0])
    elif x[1] == "BTC":
        s += float(x[0]) * 380000.0

print(s)

Submission status: Accepted

Solution code:
import numpy as np
people_num = int(input())

otoshidama_box = []

for i in range(people_num):
    value, v_type = [_ for _ in input().split()]
    value = float(value)
    if str(v_type) == "JPY":
        ans = value
    elif str(v_type) == "BTC":
        ans = value * 380000.0
    
    otoshidama_box.append(float(ans))
otoshidama_box = np.array(otoshidama_box)
total = np.sum(otoshidama_box)
print(total)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

BIT_RATE = 380000

N = int(input())
ans=0

for i in range(N):
    x, u = map(format, input().split())
    x=float(x)
    if u=="BTC":
        x*=BIT_RATE
    ans+=x
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
jpy = 0
btc = 0.0
for _ in range(n):
    money = list(input().split())
    if money[1] == 'JPY':
        jpy += int(money[0])
    else:
        btc += float(money[0])

print(jpy + (btc/1.0)*380000.0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 24 21:16:26 2019

@author: Wataru
"""

N=int(input())

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

print(total)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest 119：B - Digital Gifts


def main():
    N = int(raw_input().strip())
    x = []
    for _ in range(N):
        instr = raw_input().strip().split(' ')
        if instr[1] == 'JPY':
            y=1
        else:
            y=0
        x.append((float(instr[0]), y))
    x.sort()
    # print x

    sumy = 0.0
    for xx in x:
        if xx[1] == 1:
            sumy += xx[0]
        else:
            sumy += xx[0] * 380000.0
    print sumy


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(n):
    x = list(map(str,input().split()))
    a = x[0]
    b = x[1]
    if b == "JPY":
        ans += int(a)
    else:
        z = float(a)
        z *= 380000
        ans += z
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+=int(a)
    else:ans+=float(a)*380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
x = [0.0] * N
u = [""] * N
currency = {"JPY": 1.0, "BTC": 380000.0}
for i in range(N):
    tmp = list(input().split())
    x[i] = float(tmp[0])
    u[i] = tmp[1]

print(sum([x[i] * currency[u[i]] for i in range(N)]))

Submission status: Accepted

Solution code:
N=int(input())
J='JPY'
B='BTC'
bit=380000.0
money=0
for i in range(N):
    a,b=input().split()
    a=float(a)
    if b==J:
        money+=a
    elif b==B:
        money+=bit*a
print(money)

Submission status: Accepted

Solution code:
n = int(input())
list_test = []
for i in range(n):
    x, y = input().split()
    a = [float(x), y]
    list_test.append(a)
    
ans = 0

for i in range(n):
    if list_test[i][1] == "JPY":
        ans += int(list_test[i][0])
    else:
        ans += list_test[i][0]*380000

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
r=0.0
for i in range(n):
  m,t=input().split()
  if t == 'JPY':
    r += float(m)
  else:
    r += float(m) * 380000.0
print(r)

Submission status: Accepted

Solution code:
n = int(input())
j_wallet = []
for i in range(n):
    inp = input().split()
    if inp[1] == "JPY":
        j_wallet.append(float(inp[0]))
    else:
        j_wallet.append(float(inp[0]) * 380000.0)
print(sum(j_wallet))

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
BTC_yen = 380000.0

n = int(input())
kazu = []
tani = []
kazu_tani = [[i for i in input().split()] for i in range(n)] 

goukei = 0.0
for kt in kazu_tani:
  if kt[1] == 'JPY':
    goukei += int(kt[0])
  elif kt[1] == 'BTC':
    goukei += float(kt[0]) * BTC_yen
  
print(goukei)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

ans = 0
rate = 380000.0
b = 0

for i in [0]*N:
	x,u = input().split(' ')
	if u == 'JPY':
		x = int(x)
		ans += x
	else:
		x = float(x)
		b += x

ans = float(ans)
ans += b * rate
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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 = total + (x * 380000.0)
    
print(total)

Submission status: Accepted

Solution code:
sm=0.0
for i in xrange(int(raw_input())):
	n,s=raw_input().split()
	n=float(n)
	if s=="BTC":
		sm=sm+n*380000.0
	else:
		sm=sm+n
print "%.5f"%sm

Submission status: Accepted

Solution code:
n=int(input())
# s=[input().split(" ") for i in range(n)]
JPY=0
BTC=0

for i in range(n):
    s=input().split()
    x=float(s[0])
    u=s[1]
    if(u=="JPY"):
        JPY+=x
    else:
        BTC+=x

print(JPY+BTC*380000)

Submission status: Accepted

Solution code:
num = int(input())
total = 0
for i in range(num):
    gift = input().rstrip().split(" ")
    if gift[1] == "JPY":
        total += int(gift[0])
    elif gift[1] == "BTC":
        total += float(gift[0]) * 380000

print(total)

Submission status: Accepted

Solution code:
V_MAP = {'JPY':1.0,'BTC':380000.0}
N = int(input())
o = 0
for n in range(N):
    items = [s for s in input().split(" ")]
    x = float(items[0])
    u = items[1]
    o += x*V_MAP[u]
print(o)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

sum = 0

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

print(sum)

Submission status: Accepted

Solution code:
N = int(input())

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

print(m)

Submission status: Accepted

Solution code:
input_n = input() # お年玉をくれた人数
cash_all = 0

# データの獲得
list_cash = []
for i in range(int(input_n)):
  _ = input()
  list_cash.append(_)

# 変換して計算
list_tmp = []
for i in list_cash:
  list_tmp = i.split(' ')
  if list_tmp[1] == 'JPY':
    cash_all += int(list_tmp[0])
  else:
    cash_all += float(list_tmp[0]) * 380000.0
    
print(cash_all)

Submission status: Accepted

Solution code:
N = int(input())
a = []
for n in range(N):
    a.append(input().split())

sum_ = 0.0
for d in a:
    if d[1] == "JPY":
        sum_ += int(d[0])
    else:
        sum_ += float(d[0]) * 380000.0

print(sum_)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
sum=0
N=int(input())
for i in range(N):
    x,u=input().split()
    if u=="JPY":
        
        sum+=float(x)
    else:
        sum+=float(x)*380000

    
print(sum)

Submission status: Accepted

Solution code:
from sys import stdin


def btc_to_jpy(btc):
    return btc * 380000


def main():
    input_line_list = stdin.readlines()
    n = input_line_list[0]
    x_u_list = input_line_list[1:]
    otoshidama_sum = 0.0
    for x_u in x_u_list:
        x, u = x_u.split()
        x_float = float(x)
        #print(x_float, u)
        if u == 'BTC':
            jpy = btc_to_jpy(x_float)
        else:
            jpy = x_float
        otoshidama_sum += jpy
    print(otoshidama_sum)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lst = [input().split() for _ in range(n)]
ans = 0
for i in range(n):
    lst[i][0] = float(lst[i][0])
    if lst[i][1] == 'BTC':
        lst[i][0] *= 380000

    ans += lst[i][0]
print(ans)

Submission status: Accepted

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

y = []
for i in x:
    if i[1] == 'JPY':
        y.append(int(i[0]))
    else:
        y.append(float(i[0]) * 380000)

print(sum(y))

Submission status: Accepted

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

Submission status: Accepted

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