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

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

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

Submission status: Accepted

Solution code:
# 2019/02/24
# AtCoder Beginner Contest 119 - B

# Input
n = int(input())
sum = [0, 0]

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

# Output
print(sum[0] + sum[1] * 380000.0)

Submission status: Accepted

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[]
for i in range(N):
    data.append([(x) for x in stdin.readline().rstrip().split()])

ans=0.0
for j in data:
    if j[1] == "BTC":
        ans+=(float(j[0])*380000.0)
    else:
        ans+=float(j[0])
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

sum = 0.0
N = int(input())

for i in range(N):
    num, t = input().split()
    num = float(num)

    if (t == 'BTC'):
        num = num * 380000.0

    sum += num

print('{:.10f}'.format(sum))

Submission status: Accepted

Solution code:
N = input()
sum = 0
for i in range(int(N)):
    s = input()
    money = float(s.split()[0])
    unit = s.split()[1]
    if unit == "JPY":
        sum += money
    else:
        sum += money * 3.8 * (10**5)

print(sum)

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

def fun():
    n = int(input())
    total = 0

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


if __name__ == '__main__':
    fun()

Submission status: Accepted

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

for _ in range(N):
    xu = input().split(" ")
    x = float(xu[0])
    u = xu[1]
    if u == 'JPY':
        Otoshidama += x
    else:
        Otoshidama += x*380000
    
print(Otoshidama)

Submission status: Accepted

Solution code:
N = int(input())

sum = 0

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

    if u == 'JPY':
        sum += int(x)
    else:
        sum += float(x) * 380000.0

print(sum)

Submission status: Accepted

Solution code:
n = int(input())

pair = []
for i in range(n):
	pair.append(list(map(str, input().split())))

sum = 0
for i in range(n):
	if pair[i][1] == 'BTC':
		sum += 380000 * float(pair[i][0])
	else:
		sum += float(pair[i][0])
print(sum)

Submission status: Accepted

Solution code:
N = int(raw_input())
x = list()
u = list()
count = 0
for i in xrange(N):
    array = list(raw_input().split())
    if array[1] == 'JPY': unit = 1.0
    else: unit = 380000.0
    count += unit * float(array[0])

print count

Submission status: Accepted

Solution code:
SCALE = 380000

N = int(input())
ans = 0
for i in range(N):
    s = input().split()
    if s[1] == "JPY":
        ans += float(s[0])
    elif s[1] == "BTC":
        ans += float(s[0]) * SCALE

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for _ in range(n):
    x_i, u_i = list(input().split())
    if u_i == "JPY":
        ans += int(x_i)
    else:
        ans += float(x_i) * 380000

print(ans)

Submission status: Accepted

Solution code:
import sys

oto = []

N = int(sys.stdin.readline())
for i in range(N):
    input_lines = sys.stdin.readline()
    oto.append(input_lines.split())


mny = 0

for i in range(N):
    if(oto[i][1] == "BTC"):
        mny += float(oto[i][0]) * 380000
    else:
        mny += float(oto[i][0])
        
print(mny)

Submission status: Accepted

Solution code:
N = int(input())
Y = 0.0
for i in range(N):
    x, u = input().split()

    if u=='BTC':
        Y += float(x)*380000
    else:
        Y += float(x)

print(Y)

Submission status: Accepted

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

Submission status: Accepted

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

total = 0  
for x in X:
  if x[1] == "JPY":
    total += x[0]
  else:
    total += x[0] * 380000.0
print(total)

Submission status: Accepted

Solution code:
import sys

def parse(inp):
    N=int(next(inp).split()[0])
    
    gifts=[[] for _ in range(N)]
    
    for i in range(N):
        gifts[i]=list(next(inp).split())
    return N,gifts
  
def main(inp):
    N=inp[0]
    gifts=inp[1]
    
    total = 0
    
    for i in range(N):
        if(gifts[i][1]=="JPY"):
            total += int(gifts[i][0])
        elif(gifts[i][1]=="BTC"):
            total += float(gifts[i][0])*380000.0
            
    return total
  
print(main(parse(sys.stdin)))

Submission status: Accepted

Solution code:
N = int(input())

x = [0 for p in range(N)]
for i in range(N):
    x[i] = input().split()

sum = 0
for j in range(N):
    if x[j][1] == "JPY":
        sum += float(x[j][0])
    else:
        sum += float(x[j][0]) * 380000

print(sum)

Submission status: Accepted

Solution code:
n=int(input())
s=[input().split() for i in range(n)]
s=[[float(l[0]), l[1]] for l in s]
s=sum([l[0]*380000.0 if l[1] == 'BTC' else l[0] for l in s])
print(s)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
result = 0
n = int(input())
for i in range(n):
    x, u = input().split(" ")
    if u == 'JPY':
        result += int(x)
    else :
        result += float(x)*380000
print("{}".format(result))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

total = 0
for i in range(n):
    [m, type] = input().split(" ")
    if type == "JPY":
        total += float(m)
    else:
        total += 380000.0 * float(m)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line_num = int(input())
otoshidama_list = []
bitcoin_rate = 380000.0

for _ in range(line_num):
    line = input().split(' ')
    otoshidama = (float(line[0]), line[1])
    otoshidama_list.append(otoshidama)


def trans_otoshidama(otoshidama):
    if otoshidama[1] == "JPY":
        return otoshidama[0]
    else:
        return otoshidama[0] * bitcoin_rate


trans_list = list(map(trans_otoshidama, otoshidama_list))
print(sum(trans_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
jpy = []
btc = []
for _ in range(int(input())):
    s = [x for x in input().split()]
    if s[1] == "JPY":
        jpy.append(float(s[0]))
    else:
        btc.append(float(s[0]))
print(sum(jpy) + sum(btc)*380000)

Submission status: Accepted

Solution code:
N=int(input())

sum=0.0
for i in range(N):
    data=input().split()
    if data[1] == 'JPY':
        alpha=1.0
    else:
        alpha=380000.0
    sum = sum + alpha*float(data[0])
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
x = [[i for i in input().split()] for j in range(n)]
sum = 0
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())
total = 0.0

for i in range(n):
  num, param = input().split(' ')
  if param == "JPY":
    total += float(num)
  else:
    total += float(num) * 380000.0

print(total)

Submission status: Accepted

Solution code:
N=int(raw_input())

#ary=[]

sum=0

for i in range(N):
    X,U = raw_input().split()
    if U == 'JPY':
        sum = sum + int(X)
    else:
#        print float(X) * 380000
        sum = sum + (float(X) * 380000)

print sum

Submission status: Accepted

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

JPY = 'JPY'
BTC = 'BTC'
RAITO_BTC_TO_JPY = 380000
# 1.0 BTC == 380000.0 円

def solve(N: int, x: "List[float]", u: "List[str]"):
    #x_ = list(map(standardize_to_JPY, zip(x,u)))
    x_ = []
    for i in range(N):
        x_.append(standardize_to_JPY(x[i], u[i]))
    print(sum(x_))
    return

def standardize_to_JPY(xi, ui):
    if ui == BTC:
        return xi * RAITO_BTC_TO_JPY
    else:
        return xi

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:
# B
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    u = str(u)
    if u == 'BTC':
        ans += (x*380000)
    else:
        ans += x
print(ans)

Submission status: Accepted

Solution code:
a = []
n = int(input())
for i in range(n):
    a.append(input().split())
s = 0.0
for i in range(n):
    if (a[i][1])=="BTC":
        s += float(a[i][0]) * 380000.0
    else:
        s += float(a[i][0])
print(s)

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

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

Submission status: Accepted

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

@author: Yamazaki Kenichi
"""

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

ans = 0
for i in range(N):
    if A[i][1] == 'BTC':
        ans += float(A[i][0])*380000
    else:
        ans += int(A[i][0])
print(ans)

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)
y = 0
b = 0
for i in range(n):
  if u[i] == 'JPY':
    y += x[i]
  else:
    b += x[i]
print(y + b*380000.0)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
	L[i][0] = float(L[i][0])
total = 0
for i in range(N):
	if L[i][1] == 'JPY':
		total = total +  L[i][0]
	elif L[i][1] == 'BTC':
		total = total +  L[i][0]*380000
print(total)

Submission status: Accepted

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

result = 0

for val, tsuka in otoshidama:
    if tsuka == 'BTC':
        result += 380000 * float(val)
    else:
        result += float(val)

print(result)

Submission status: Accepted

Solution code:
n = int(input())

x= [0,0,0,0,0,0,0,0,0,0]
v= [0,0,0,0,0,0,0,0,0,0]
ans = 0
for i in range(n):
    x[i], v[i] = input().split()

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
J = 0.0
B = 0.0

for n in range(N):
    v, s = input().split()
    if s == "JPY":
        J += float(v)
    else:
        B += float(v)

print(J + B * 380000.0)

Submission status: Accepted

Solution code:
n = int(input())

sum=0

for i in range(n):
    m,k = input().split(' ')
    m = float(m)
    if k=='BTC':
        m*=380000.0
    sum+=m

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
li = []
A =[]
B=[]
for i in range(N):
    li = list(input().split())
    A.append(float(li[0]))
    B.append(li[1])
# print(li)
# print(A)
# print(B)
i = 0
res=0
for i in range(N):
    if(B[i]=="JPY"):
        res+=A[i]
    else:
        res+=380000*A[i]

print(res)

Submission status: Accepted

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

sum = 0
for l in listA:
    if l[1] == "JPY":
        sum += float(l[0])
    else:
        sum += float(l[0]) * 380000.0

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
	kingaku, syurui = input().split()
	if syurui == 'BTC':
		total += float(kingaku) * 380000
	else:
		total += float(kingaku)

print(total)

Submission status: Accepted

Solution code:
import math
import numpy as np
import sys
def IL(): return list(map(int,sys.stdin.readline().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
xu = [SL() for i in range(N)]
j = 0
b = 0

for i in xu:
    x,u = i
    if u == "JPY":
        j += float(x)
    else:
        b += float(x)*380000

print(j+b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
a  =int(input())

su = 0

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

print(su)

Submission status: Accepted

Solution code:
num = input()
en = 0.0
for x in range(int(num)):
    num1 = input().split()
    if(num1[1] == "JPY"):
        en += float(num1[0])
    else:
        en += float(num1[0])*380000.0
print(en)

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor

import heapq
import itertools
import operator


inf = float('inf')


def get_int():
    return int(input())


def get_str():
    return input().strip()


def get_list_of_float():
    return [float(i) for i in input().split()]


def get_char_list():
    return list(input().strip())


YPB = 380000.0


# inputs
N = 0
X = [0.0]
U = [""]


def set_inputs():
    global N, X, U
    N = get_int()
    X = []
    U = []
    for _ in range(N):
        x, u = get_str().split()
        X.append(float(x))
        U.append(u)


def main():
    set_inputs()
    sum = 0.0
    for i in range(N):
        u = 1
        if U[i] == 'BTC':
            u = YPB
        sum += X[i] * u
    print(sum)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
list = [list(map(str,input().split())) for i in range(N)]
sum = 0
for ele in list:
    if ele[1]=="JPY":
        sum += int(ele[0])
    else:
        sum += (float(ele[0])*380000.0)

print(sum)

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()
y = list(map(float, x))

ans = 0
for i in range(N):
    if u[i] == 'JPY':
        ans += y[i]
    else:
        ans += y[i]*380000
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
btc = 380000.0
ans = 0
for i in range(N):
    x, y = input().split()

    if y == "BTC":
        work = btc * float(x)
    else:
        work = float(x)

    ans += work

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = []
u = []
for _ in range(n):
    xi, ui = list(input().split())
    x.append(float(xi))
    u.append(ui)
    
yen = 0
for i in range(n):
    if u[i] == 'JPY':
        yen += x[i]
    else:
        yen += x[i] * 380000.0

print(yen)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ot = [input().split() for _ in range(n)]
s = 0
for y, b in ot:
  if b == 'JPY':
    s += float(y)
  else:
    s += float(y) * 380000.0
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 += int(x)
    else:
        sum += float(x) * 380000

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
import random
import bisect
#from statistics import mean, median, variance, stdev

#template input

def IT(): #整数1個
    return int(input())
def IL(): #整数複数
    return [int(_) for _ in input().split()]
def IS(): #文字列複数
    return [_ for _ in input().split()]
def ILS(n): #整数1つ　縦にズラーってなってるやつ
    return [int(input()) for _ in range(n)]
def SLS(n): #文字列　縦にズラーってなってるやつ
    return [input() for _ in range(n)]
def ILSS(n): #整数複数　縦にズラーってなってるやつ
    return [[int(_) for _ in input().split()] for j in range(n)]

#template technique
def bit_full_search(ss):
    n = len(ss)
    for i in range(1 << n):
        s = ""
        for j in range(n + 1):
            if ((1 & i >> j) == 1):
                s += ss[j]
        print(s)
def bit_full_search2(A):
    #https://blog.rossywhite.com/2018/08/06/bit-search/
    value = []
    for i in range(1 << len(A)):
        output = []

        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                #output.append(A[j])
                output.append(A[j])
        value.append([format(i, 'b').zfill(16), sum(output)])

    value.sort(key=lambda x:x[1])
    bin = [value[k][0] for k in range(len(value))]
    val = [value[k][1] for k in range(len(value))]
    return bin, val
def matching_bisect(list1_val, list2_val, n):
    #2分探索
    j = 0
    for i in range(len(list1_val)):
        j = bisect.bisect_left(list2_val, n - list1_val[i])
        if j < len(list2_val):
            if list1_val[i] + list2_val[j] == n:
                #ans = list2_bin[j] + list1_bin[i]
                break
    return j

"""ここからメインコード"""


def main():
    n = IT()
    xu = []
    for i in range(n):
        xu.append(input().split())

    ans = 0
    for i in range(n):

        if xu[i][1] == "JPY":
            ans += float(xu[i][0])
        else:
            ans += float(xu[i][0]) * 380000


    print(ans)
    #print(n)
    #print(x)
    #print(u)

main()

Submission status: Accepted

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

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())
xs, us = [], []
for _ in range(n):
  x, u = input().split(' ')
  xs.append(float(x))
  us.append(u)
total_yen = 0
for x, u in zip(xs, us):
  if u == 'BTC':
    total_yen += (x*380000.0)
  else:
    total_yen += x
print(total_yen)

Submission status: Accepted

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

print(output)

Submission status: Accepted

Solution code:
t = int(input())

s = 0
for i in range(t):
    x,y = input().split()
    if(y == "JPY"):
        s += float(x)
    else:
        s += float(x) * 380000

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A

"""
s = input().split("/")
if int(s[1]) <= 4:
    print("Heisei")
else:
    print("TBD")

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

Submission status: Accepted

Solution code:
def y():
  for _ in range(int(input())):
    x, u = input().split()
    x = float(x)
    yield x if u=='JPY' else x*380000
print(sum(y()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import re
from datetime import datetime as dt
if __name__ == '__main__':
    n = input()
    sum = 0.0
    for i in range(n):
        x, u = raw_input().split()
        if u == 'JPY':
            sum += int(x)
        else:
            sum += float(x) * 380000
    print sum

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
X=list()
U=list()
for i in range(N):
    a,b = [i for i in input().split()]
    X.append(float(a))
    U.append(b)
sum=0.0
for price,kind in zip(X,U):
    if kind == 'JPY':
        sum += price
    else:
        sum+= 380000 * price
print (sum)

Submission status: Accepted

Solution code:
jpy_per_btc = 380000.0

n = int(input())
money = []
for _ in range(n):
    (x, u) = input().split()
    is_jpy = ("JPY" == u)
    money.append([int(x) if is_jpy else float(x), is_jpy])

sum = 0
for i in money:
    sum += i[0] if i[1] else (i[0] * jpy_per_btc)
print(sum)

Submission status: Accepted

Solution code:

n = int(input())


ans = 0.0
for _ in range(n):
    
    n,u = input().split()
    money = float(n)
    is_jpy = u == 'JPY'

    ans += money if is_jpy else money * 380000.0
    

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    N = int(input())
    cnt = 0
    for i in range(N):
        x, u = input().split(' ')
        if u == 'JPY':
            cnt += float(x)
        else:
            cnt += float(x)*380000.0
    print('{}'.format(cnt))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
BTC_RATE = 380000.0

N = input()
N = int(N)

x_list, u_list = [],[]
for i in range(N):
	x, u = list(input().split())
	x_list.append(float(x))
	u_list.append(u)

ans = 0.0
for x,u in zip(x_list, u_list):
	if u == "JPY":
		ans += x
	else:
		ans += x * BTC_RATE

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

total_jpy = 0
for i in range(n):
    x_str, u = input().split(' ')
    x = float(x_str)
    if u == 'JPY':
        total_jpy += x
    else:
        x_jpy = x * 380000.0
        total_jpy += x_jpy

print(total_jpy)

Submission status: Accepted

Solution code:
n=int(input())
x=[]
u=[]
for i in range(n):
  a,b=input().split()
  x.append(float(a))
  u.append(b)

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

Submission status: Accepted

Solution code:
N = int(input())

r = 380000
ans = 0
for _ in range(N):
    a, b = input().split()
    x = float(a)
    if b == 'BTC':
        x *= r
    ans += x

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
X=[]
U=[]
ans=0
for i in range(n):
    x,u=input().split()
    x=float(x)
    X.append(x)
    U.append(u)

for i in range(n):
    if U[i]=='JPY':
        ans += X[i]
    else:
        ans += X[i]*380000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

X = []
U = []
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
btc_to_yen = 380000.0
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*btc_to_yen
print(sum)