Problem:


Score : 200 points

Problem Statement

Takahashi received otoshidama (New Year's money gifts) from N of his relatives.

You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC, and x_i and u_i represent the content of the otoshidama from the i-th relative.

For example, if x_1 = 10000 and u_1 = JPY, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = 0.10000000 and u_2 = BTC, the otoshidama from the second relative is 0.1 bitcoins.

If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?

Constraints

2 \leq N \leq 10

u_i = JPY or BTC.

If u_i = JPY, x_i is an integer such that 1 \leq x_i \leq 10^8.

If u_i = BTC, x_i is a decimal with 8 decimal digits, such that 0.00000001 \leq x_i \leq 100.00000000.

Input

Input is given from Standard Input in the following format:

N
x_1 u_1
x_2 u_2
:
x_N u_N

Output

If the gifts are worth Y yen in total, print the value Y (not necessarily an integer).

Output will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5}.

Sample Input 1

2
10000 JPY
0.10000000 BTC

Sample Output 1

48000.0

The otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.

Outputs such as 48000 and 48000.1 will also be judged correct.

Sample Input 2

3
100000000 JPY
100.00000000 BTC
0.00000001 BTC

Sample Output 2

138000000.0038

In this case, outputs such as 138001000 and 1.38e8 will also be judged correct.



Sample input:
2
10000 JPY
0.10000000 BTC


Sample output:
48000.0

Submission status: Accepted

Solution code:
N=int(input())
x = []
u = []
for _ in range(N):
    xt,ut = input().split()
    xt = float(xt)
    x.append(xt)
    u.append(ut)
ans = 0
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())
total = 0

for i in range(n):
  x_temp, u_temp = input().split()
  x_temp = float(x_temp)
  if u_temp == 'BTC':
    x_temp *= 380000.0
  total += x_temp
  
print(total)

Submission status: Accepted

Solution code:
n = int(input())
btc_rate = 380000.0
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    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)
    if u == "JPY":
        ans += x
    else:
        ans += x*380000

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

for _ in range(N):
    x,u = [i for i in input().split()]
    x=float(x)
    if u=="JPY":
        ans+=x
        continue
    else:
        ans+=x*RATE
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
dic = {}
for _ in range(N):
    vals = input().split()
    if vals[1] not in dic:
        dic[vals[1]] = float(vals[0])
    else:
        dic[vals[1]] += float(vals[0])
tot = 0  
for k in dic:
    if k == "JPY":
        tot += dic[k]
    else:
        tot += dic[k] * 380000.0
print(tot)

Submission status: Accepted

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

N = int(input().split()[0])
xu_list = []

for _ in range(N):
    x, u = list(input().split())
    xu_list.append((float(x), u))

total = 0

for xu in xu_list:
    x, u = xu
    total += x * 38 * 10 ** 4 if u == "BTC" else x

ans = total
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

s=0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
MONEY=0
for i in range(N):
    a,b=input().split()

    if b=='BTC':
        MONEY+= float(a)*380000

    elif b=='JPY':
        MONEY+= int(a)

print(MONEY)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
l1=[]
l2=[]
for _ in range(N):
  x,u=input().split()
  if u=='JPY':
    l1.append(int(x))
  elif u=='BTC':
    l2.append(float(x))
print(sum(l1)+sum(l2)*380000)

Submission status: Accepted

Solution code:
n = int(input())
x = [0.]*n
u = ['']*n
for i in range(n):
    xu = input().split()
    x[i], u[i] = float(xu[0]), str(xu[1])

sum = 0
for i in range(n):
    if u[i] == 'BTC':
        sum += x[i] * 380000.0
    else:
        sum += x[i]

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
c=0
for i in range(N):
    x,u=map(str,input().split())
    c+=float(x)*((u[0]=='B')*379999+1)
print(c)

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:
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *
# from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    N = int(input())
    ans = 0
    for i in range(N):
        num,st = input().rstrip().split(' ')
        num = float(num)
        if st == 'JPY':
            ans += num
        else:
            ans += num*380000
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
d = {"JPY" : 1.0, "BTC" : 380000.0}
ans = 0
for _ in range(n):
    x, u = input().split()
    ans += float(x) * d[u]
print(ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    btc = 380000
    t = 0
    for _ in range(n):
        v, k = input().split()
        v = float(v)
        t += v if k == "JPY" else v * btc
    print(t)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    t = 0
    for i in range(n):
        a, b = list(map(str, str(input().rstrip('\n')).split()))
        if b == "JPY":
            t += int(a)
        else:
            t += (float(a) * 380000)
    print(t)


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

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

print(total_amount)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    N = int(input())

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



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = input()
RATE = 380000.0
ans = 0.0
for i in range(n):
    inpt = map(str, raw_input().split())
    if inpt[1] == "JPY":
        ans += float(inpt[0])
    else:
        ans += float(inpt[0]) * RATE

print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
XU=[tuple(map(str,input().split())) for i in range(n)]

jpy=0
btc=0

for xu in XU:
    x=xu[0]
    u=xu[1]
    if u=="JPY":
        jpy+=int(x)
    else:
        btc+=float(x)
        
print(jpy+380000*btc)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys 
stdin = sys.stdin
ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())

n = ni()
btc = 380000
ans = 0
for _ in range(n):
  a, b = ns().split()
  if b == "BTC":
    ans += float(a) * btc
  else:
    ans += int(a)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

x = []
u = []

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

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:
s=int(input())
jpy=0
btc=0
for i in range(s): 
  t,u=input().split()
  if u=='JPY':
    jpy+=int(t)
  else:
    btc+=float(t)
print(jpy+380000*btc)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(5 * 10**5)
input = sys.stdin.readline

N = int(input())

jpy = 0
btc = 0

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

    if u == "JPY":
        jpy += int(x)
    else:
        btc += float(x)

print(jpy + btc * 380000)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N= int(input())
total_otoshidama = float(0)
otoshidama_list = []
for i in range(N):
    xi, ui = input().split()
    if ui == 'BTC':
        xi = float(xi)
        xi = xi*380000
    else:
        xi = int(xi)
    total_otoshidama += xi
print(total_otoshidama)

Submission status: Accepted

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

Submission status: Accepted

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

total = 0
for gift in gifts:
    if gift[1] == "JPY":
        total += float(gift[0])
    else:
        total += float(gift[0]) * 380000

print(total)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
def calc(p):
  if p[1]=='JPY':
    return int(p[0])
  else:
    return float(p[0])*380000.0
ans = 0
for _ in range(n):
  a = input().split()
  ans += calc(a)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
otoshidama = []
for n in range(N):
    val, cur = map(str, input().split())
    val = float(val)
    if cur == "BTC":
        val *= 380000
    otoshidama.append(val)
print(sum(otoshidama))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

sum=0
for i in range(N):
    a,b =input().split()
    c=float(a)
    if b == 'BTC':
        c=c*380000
    sum +=c
    
print(sum)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

n=int(input())

l=[list(map(str,input().split())) for _ in range(n)]

cnt=0

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

Submission status: Accepted

Solution code:
N = int(input())

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

btc = 380000.0 * btc
print(jpy + btc)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res = 0

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

    if u=="JPY":
        result+=int(x)
    else:
        result+=380000*float(x)

print(result)

Submission status: Accepted

Solution code:
# ABC119b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())
x = [list(input().split()) for _ in range(n)]
ans = 0

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

Submission status: Accepted

Solution code:
N = int(input())
xlist = []
ulist = []
for _ in range(N):
    x, u = map(str, input().split())
    xlist.append(float(x))
    ulist.append(u)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
x=[]
for i in range(n):
    a,b=input().split()
    x.append((float(a),b))
s=0
for i in range(n):
    if x[i][1]=='JPY':
        s+=x[i][0]
    else:
        s+=x[i][0]*38e4
print(s)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
ans=0
n=int(input())
rate = 380000
for i in range(n):
    x,u = input().split()
    if u == 'BTC':
        ans+=float(x)*rate
    else:
        ans+=float(x)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
ans = 0
for _ in range(int(input())):
    pri,uni = input().split()
    if uni == "BTC":ans += float(pri)*3.8e5
    else:ans += int(pri)
print(ans)

Submission status: Accepted

Solution code:
pri,uni = 0,0
jsum,bsum = 0,0
for _ in range(int(input())):
    pri,uni = input().split()
    pri = float(pri)
    if uni == "JPY":jsum += pri
    else:bsum += pri
print(jsum + bsum*3.8e5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

l = [[i for i in input().split()] for _ in range(n)]
ans = 0
for i in l:
    if i[1] == 'JPY':
        ans += float(i[0])
    else:
        ans += float(i[0])*380000

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i 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:
import sys
input = sys.stdin.readline
N = int(input())
ans = 0
for i in range(N):
    price, typ = input().split()
    price = float(price)
    if typ == 'BTC':
        ans += price * 380000
    else:
        ans += price
print(ans)

Submission status: Accepted

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

n = int(input())


sum = 0
for i in range(n):
    temp_x, u = input().split()
    x = float(temp_x)
    if u == "JPY":
        sum += x
    else:
        sum += x*380000.0

print(sum)

Submission status: Accepted

Solution code:
N=int(input())
ans=0
for i 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())
otoshidama = lambda a,b:float(a)*380000 if b=="BTC" else int(a)
y=0
for i in range(N):
  x,u = input().split()
  y += otoshidama(x,u)
print(y)

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())
XU = [input().split()for _ in range(N)]

cnt = 0
for n in range(N):
    if (XU[n][1] == "JPY"): cnt += int(XU[n][0])
    else: cnt += float(XU[n][0]) * 380000

print (cnt)

Submission status: Accepted

Solution code:
n = int(input())

result = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

result=0
for item in range(n):
  a,b=map(str,input().split())
  if b=="JPY":
    result+=float(a)
  else:
    result+=float(a)*380000.0
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s = [list (input().split()) for i in range(n)]
q=[float(s[i][0]) for i in range(n)]
price=[]
for j in range(n):
  if s[j][1]=='JPY':
    price.append(1)
  elif s[j][1]=='BTC':
    price.append(380000.0)
ans=sum(q[k]*price[k] for k in range(n))
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
x=[]
u=[]
for i in range(n):
    X,U = input().split()
    x.append(float(X))
    u.append(U)
ans = 0
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())
A = []
BTC = 380000.0
ans = 0
for _ in range(N):
    x,u = input().split()
    tmp = (float(x),u)
    A.append(tmp)
for a in A:
    x = a[0]
    u = a[1]
    if u == "JPY":
        ans += x
    else:
        ans += x*BTC
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

total = 0
for i in range(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:
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
  x[i], u[i] = map(str, input().split())
conv = 380000
total = 0
for i in range(N):
  if u[i] == 'BTC':
    x[i] = conv * float(x[i])
  total += float(x[i])
print(total)

Submission status: Accepted

Solution code:
N = int(input())

def get():
    x, u = input().split()
    if u == "JPY":
        return float(x)
    else:
        return float(x) * 380000.0

ans = sum([get() for i in range(N)])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(n):
  info = input().split()
  if info[1] == 'JPY':
    ans += float(info[0])
  else:
    ans += float(info[0]) * 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 += int(x)
  else:
    ans += float(x)*38*(10**4)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
rate=380000.0 #yen/btc

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for 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())
r = 0
for i in range(N):
  xs, u = input().split()
  if u == "JPY":
    r += int(xs)
  if u == "BTC":
    r += float(xs)*380000.0
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=0
for _ in range(int(input())):
  x,y=input().split()
  if(y=='BTC'):
    n+=float(x)*38e4
  else:
    n+=float(x)
print(n)

Submission status: Accepted

Solution code:
N = int(input())
M = [input().split() for i in range(N)]
ans = 0
for i in range(N):
    ans += float(M[i][0])*(380000*(int(M[i][1]=="BTC"))+(int(M[i][1]=="JPY")))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def exchange(btc):
  return 380000.0 * btc
 
n = int(input())
sum = 0.0
for i in range(n):
  a, b = input().split()
  if "JPY" in b:
    sum += float(a)
  else:
    sum += exchange(float(a))
 
print(sum)