Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

R,G,B,N =[int(x) for x in input().split()]
a = 0
for i in range(N//R+1):
    for j in range(((N-(i*R))//G)+1):
        if N -i*R-j*G >=0 and (N -i*R-j*G)%B == 0:
            a += 1
                       
           

print(a)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

R,G,B,N =[int(x) for x in input().split()]
a = 0
for i in range(N//R+1):
    for j in range(((N-(i*R))//G)+1):
        if (N -i*R-j*G)%B == 0:
            a += 1
                       
           

print(a)

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

R,G,B,N =[int(x) for x in input().split()]
a = 0
for i in range(N//R+1):
    for j in range(((N-(i*R))//G)+1):
        if N -i*R-j*G ==0:
            a += 1
            
        
        elif(N -i*R-j*G)%B == 0 and (N -i*R-j*G) > 0:
            a += 1
          
        
            
           

print(a)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

R,G,B,N =[int(x) for x in input().split()]
a = 0
for i in range(N//R+1):
    for j in range(((N-(i*R))//G)+1):
        if (N -i*R-j*G)%B == 0:
            a += 1
                       
           

print(a)

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

R,G,B,N =[int(x) for x in input().split()]
count = 0
for i in range(N//R +2):
    for j in range(N//G +2):
        for k in range(N//B +2):
            
            if i*R+j*G+k*B == N:
                count += 1

print(count)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

R,G,B,N =[int(x) for x in input().split()]
a = 0
for i in range(N//R+1):
    for j in range(((N-(i*R))//G)+1):
        if (N -i*R-j*G)%B == 0:
            a += 1
                       
           

print(a)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
S = list(input())
K = int(input())
a = S[K-1]
ans = []
for k in S:
    if k != a:
        ans.append("*")
    else:
        ans.append(k)

answer = "".join(ans)
print(answer)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
A,B,C = [int(x) for x in input().split()]

if A<B:
    if A<C and C<B:
        print("Yes")
    else:
        print("No")
else:
    if B<C and C<A:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
Hlist = [int(x) for x in input().split()]

count = 0
for i in range (N):
    if Hlist[i] >= max(Hlist[0:i+1]):
        count+= 1

print(count)


Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
A, B = [int(x) for x in input().split()]
if A>B:
  ans = A + A-1
elif B>A:
  ans = B+B-1
else:
  ans = 2*A

print(ans)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
ansls=[]
k = input()
for i in range(4):
    m = ls[i+1]-ls[i]
    ansls.append(m)

if max(ansls)>k:
    print(':(')
else:
    print('Yay!')

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
k = int(input())
if ls[4]-ls[0] <= k:
    print('Yay!')
else:
    print(':(')

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(4):
    ls.append(int(input()))
ansls=[]
k = input()
for i in range(4):
    m = ls[i+1]-ls[0]
    ansls.append(m)

if max(ansls)>k:
    print(':(')
else:
    print('Yay!')

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
k = int(input())
if ls[4]-ls[0] <= k:
    print('Yay!')
else:
    print(':(')

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(4):
    ls.append(int(input()))
ansls=[]
k = input(k)
for i in range(4):
    m = ls[i+1]-ls[0]
    ansls.append(m)

if max(ansls)>k:
    print(':(')
else:
    print('Yay!')

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
k = int(input())
if ls[4]-ls[0] <= k:
    print('Yay!')
else:
    print(':(')
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))

lasttime = 10
for a in ls:
    b = a%10
    if b < lasttime and b != 0:
        lasttime = b
        ans =a

ls.remove(ans)
sum =0
for i in ls:
    if i%10 ==0:
        sum +=i
    else:
        p = i//10
        sum += (p+1)*10

print(int(sum + ans))



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
ls2 = [i%10 for i in ls]
if ls2 == [0,0,0,0,0]:
    print(sum(ls))
else:
    lasttime = 10
    for a in ls:
        b = a%10
        if b < lasttime and b != 0:
            lasttime = b
            ans =a

    ls.remove(ans)
    sum =0
    for i in ls:
        if i%10 ==0:
            sum +=i
        else:
            p = i//10
            sum += (p+1)*10

    print(int(sum + ans))

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))

lasttime = 10
for a in ls:
    b = a%10
    if b < lasttime:
        lasttime = b
        ans =a

ls.remove(ans)
sum =0
for i in ls:
    if i%10 ==0:
        sum +=i
    else:
        p = i//10
        sum += (p+1)*10

print(int(sum + ans)



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
ls2 = [i%10 for i in ls]
if ls2 == [0,0,0,0,0]:
    print(sum(ls))
else:
    lasttime = 10
    for a in ls:
        b = a%10
        if b < lasttime and b != 0:
            lasttime = b
            ans =a

    ls.remove(ans)
    sum =0
    for i in ls:
        if i%10 ==0:
            sum +=i
        else:
            p = i//10
            sum += (p+1)*10

    print(int(sum + ans))

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))

lasttime = 10
for a in ls:
    b = a%10
    if b < lasttime:
        lasttime = a

ls.pop(a)
sum =0
for i in ls:
    if i%10 ==0:
        sum +=i
    else:
        p = i//10
        sum += (p+1)*10

print(sum)



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
ls2 = [i%10 for i in ls]
if ls2 == [0,0,0,0,0]:
    print(sum(ls))
else:
    lasttime = 10
    for a in ls:
        b = a%10
        if b < lasttime and b != 0:
            lasttime = b
            ans =a

    ls.remove(ans)
    sum =0
    for i in ls:
        if i%10 ==0:
            sum +=i
        else:
            p = i//10
            sum += (p+1)*10

    print(int(sum + ans))
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = []
for _ in range(5):
    ls.append(int(input()))
if N <= min(ls):
    print(5)
else:
    mint = min(ls)
    ans = 5 + min//N +1
    print(ans)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import math

N = int(input())
ls = []
for _ in range(5):
    ls.append(int(input()))

if N <= min(ls):
    print(5)
else:
    mint = min(ls)
    ans = 4 + math.ceil(N/mint) 
    print(ans)

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = []
for _ in range(5):
    ls.append(int(input()))
if N <= min(ls):
    print(5)
    else:
        mint = min(ls)
        ans = 5 + min//N +1
        print(ans)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import math

N = int(input())
ls = []
for _ in range(5):
    ls.append(int(input()))

if N <= min(ls):
    print(5)
else:
    mint = min(ls)
    ans = 4 + math.ceil(N/mint) 
    print(ans)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
A,B,C = [int(x)for x in input().split]
if A == B == C:
    print("Yes")
else:
    print('No')



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
A,B,C = [int(x)for x in input().split()]
if A == B == C:
    print("Yes")
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for a in S:
    
    if a == 'A' or a =='T' or a == 'C' or a =='G':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
clst=[]
count = 0
for s in S:
    if s == 'A' or s == 'T' or s =='C' or s == 'G':
        count += 1
        clst.append(count)
    else:
        
        count = 0
        clst.append(count)
print(max(clst))

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in range(len(S)):
    
    if S[i] == 'A' or S[i] =='T' or S[i] == 'C' or S[i] =='G':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
clst=[]
count = 0
for s in S:
    if s == 'A' or s == 'T' or s =='C' or s == 'G':
        count += 1
        clst.append(count)
    else:
        
        count = 0
        clst.append(count)
print(max(clst))

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in range(len(S)):
    
    if S[i] == 'A' or 'T' or 'C' or'G':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
clst=[]
count = 0
for s in S:
    if s == 'A' or s == 'T' or s =='C' or s == 'G':
        count += 1
        clst.append(count)
    else:
        
        count = 0
        clst.append(count)
print(max(clst))

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in range(len(S)):
    
    if S[i] in 'ATGC':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
clst=[]
count = 0
for s in S:
    if s == 'A' or s == 'T' or s =='C' or s == 'G':
        count += 1
        clst.append(count)
    else:
        
        count = 0
        clst.append(count)
print(max(clst))

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in len(S):
    
    if S[i] in 'ATGC':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
clst=[]
count = 0
for s in S:
    if s == 'A' or s == 'T' or s =='C' or s == 'G':
        count += 1
        clst.append(count)
    else:
        
        count = 0
        clst.append(count)
print(max(clst))
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N,Q = [int(x) for x in input().split()]
S = list(input())
lrlist =[]
for _ in range(Q):
    l,r = [int(x) for x in input().split()]
    lrlist.append((l,r))

sumls =[0]*(N+1)
for i in range (N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        sumls[i+1] = sumls[i] + 1
    else:
        sumls[i+1] = sumls[i]

for _ in range (Q):
    l = lrlist[_][0]
    r = lrlist[_][1]
    ans = sum(sumls[r-1]-sumls[l-1])
    print(ans)






Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N,Q = [int(x) for x in input().split()]
S = list(input())
lrlist =[]
for _ in range(Q):
    l,r = [int(x) for x in input().split()]
    lrlist.append((l,r))

sumls =[0]*(N+1)
for i in range (N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        sumls[i+1] = sumls[i] + 1
    else:
        sumls[i+1] = sumls[i]

for _ in range (Q):
    l = lrlist[_][0]
    r = lrlist[_][1]
    ans = sumls[r-1]-sumls[l-1]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N,Q = [int(x) for x in input().split()]
S = list(input())
lrlist =[]
for _ in range(Q):
    l,r = [int(x) for x in input().split()]
    lrlist.append((l,r))

sumls =[0]*(N)
for i in range (N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        sumls[i] = 1
    else:
        sumls[i] = 0

for _ in range (Q):
    l = lrlist[_][0]
    r = lrlist[_][1]
    ans = sum(sumls[l-1:r-1])
    print(ans)






Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N,Q = [int(x) for x in input().split()]
S = list(input())
lrlist =[]
for _ in range(Q):
    l,r = [int(x) for x in input().split()]
    lrlist.append((l,r))

sumls =[0]*(N+1)
for i in range (N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        sumls[i+1] = sumls[i] + 1
    else:
        sumls[i+1] = sumls[i]

for _ in range (Q):
    l = lrlist[_][0]
    r = lrlist[_][1]
    ans = sumls[r-1]-sumls[l-1]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N,Q = [int(x) for x in input().split()]
S = list(input())
lrlist =[]
for _ in range(Q):
    l,r = [int(x) for x in input().split()]
    lrlist.append((l,r))
countls=[]
for x in lrlist:
    count = 0
    Spart = S[x[0]-1:x[1]]
    for i in range(len(Spart)-1):
        if Spart[i] =='A' and Spart[i+1] =='C':
            count+= 1
    countls.append(count)

for _ in range(Q):
    print(countls[_])    

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N,Q = [int(x) for x in input().split()]
S = list(input())
lrlist =[]
for _ in range(Q):
    l,r = [int(x) for x in input().split()]
    lrlist.append((l,r))

sumls =[0]*(N+1)
for i in range (N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        sumls[i+1] = sumls[i] + 1
    else:
        sumls[i+1] = sumls[i]

for _ in range (Q):
    l = lrlist[_][0]
    r = lrlist[_][1]
    ans = sumls[r-1]-sumls[l-1]
    print(ans)
Buggy python submission (verdict: Runtime Error):
K,w = [int(x) for x in input().split()]
h,w = [int(x) for x in input().split()]
print (K*W -(K-h)*(W-w))

Fixed submission:
K,W = [int(x) for x in input().split()]
h,w = [int(x) for x in input().split()]
print ((K-h)*(W-w))
Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,M = [int(x) for x in input().split()]
ABdict = {}
for _ in range (N):
    A,B = [int(x) for x in input().split()]
    if A in ABdict.keys():
        ABdict[A] += B
    else:
        ABdict[A] = B

dct = sorted(ABdict.items())
ls = []
for pricenumber in dct:
    for i in range (pricenumber[1]):
        ls.append(pricenumber[0])

print(sum(ls[:M]))

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,M = [int(x) for x in input().split()]
ABdict = {}
for _ in range (N):
    A,B = [int(x) for x in input().split()]
    if A in ABdict.keys():
        ABdict[A] += B
    else:
        ABdict[A] = B

dct = sorted(ABdict.items())
ls = []
ans = 0
for i in dct:
    if M >= 0:
        ans += min(M,i[1])*i[0]    
        M -= i[1]  

print(ans)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
lsreverse = reverse(ls)
answer = lsreverse[K-1]
print(answer)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
ls.reverse()
answer = ls[K-1]
print(answer)

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
answer = ls[K]
 print(answer)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
ls.reverse()
answer = ls[K-1]
print(answer)

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
print(ls[K])

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
ls.reverse()
answer = ls[K-1]
print(answer)

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i in range(1,A+1) if A % i == 0 and B % i == 0]
print(ls[K])

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
ls.reverse()
answer = ls[K-1]
print(answer)

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[]
for i in range(1,A+1):
    if A % i == 0 and B % i == 0:
        ls.append(i)

print(ls[K])

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
ls.reverse()
answer = ls[K-1]
print(answer)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
y, m, d = [int(x) for x in S.split('/')]
if y>=2020:
    answer = "Heisei"
elif:
    y = 2019 and m >= 5:
    answer = "Heisei"
else:
    answer = "TBD" 

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
ls = [x for x in S.split("/")]
y = int(ls[0])
m = ls[1]
if y<=2018:
    a = "Heisei"
elif y == 2019 and m in ["01" ,"02", "03","04"]:
    a = "Heisei"
else:
    a = "TBD"
print(a)
Buggy python submission (verdict: Runtime Error):
v
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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


Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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


Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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



print(answer)
    
 



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
xls = []
uls = []
answer = 0
for _ in range(N):
    x,u = input().split()
    if u == JPY:
        money = int(x) 
    else:
        money = float(x)*380000
    answer += money



print(answer)
    
 



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

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

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
xls = []
uls = []
for _ in range(N):
    x,u = input().split()
    if u == JPY:
        x = int(x)
    else:
        x = float(x)
    xls.append(x)
    uls.append(u)

answer = 0
for i in range(N):
    if uls[i] == JPY:
        money = xls[i]
    else:
        money = xls[i]*380000
    answer += money

print(answer)
    
 


Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())

answer = 0
for _ in range(N):
    x,u = input().split()
    if u == "JPY":
        money = float(x) 
    else:
        money = float(x)*380000.0
    answer += money
print(answer)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
if sum(sorted([int(x) for x in input().split()]) > 2*sorted([int(x) for x in input().split()][-1]:
    print("Yes")
else:
    print("No")


Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
Llist = [int(x) for x in input().split()]
Llist.sort()
Llist.reverse()
if sum(Llist) > 2*Llist[0]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
if sum(sorted([int(x) for x in input().split()]) > 2*Llist[-1]:
    print("Yes")
else:
    print("No")


Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
Llist = [int(x) for x in input().split()]
Llist.sort()
Llist.reverse()
if sum(Llist) > 2*Llist[0]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
if sum([int(x) for x in input().split()].sort()) > 2*Llist[-1]:
    print("Yes")
else:
    print("No")


Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
Llist = [int(x) for x in input().split()]
Llist.sort()
Llist.reverse()
if sum(Llist) > 2*Llist[0]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N,M = [int(x) for x in input().split()]
xls = [int(x) for x in input().split()]
dls = [xls[i+1]-xls[i] for i in range(M-1)]
if N >= M:
    ans = 0


print(ans)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N,M = [int(x) for x in input().split()]
xls = [int(x) for x in input().split()]
xls.sort()
dls = [xls[i+1]-xls[i] for i in range(M-1)]
if N >= M:
    ans = 0
else:
    dls.sort()
    ans = sum(dls[0:M-N])

print(ans)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

ls = [int(x) for x in input().split()]
ls.sort()
print(int((ls[0]*ls[1])/2)


Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

ls = [int(x) for x in input().split()]
ls.sort()
print(int((ls[0]*ls[1])/2))
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

s = int(input())

ls =[s]
while True:
    if ls[-1] % 2 ==0:
        a = ls[-1]/2
    else:
        a = ls[-1]*3 + 1
    if a in ls:
        break
    else:
        ls.append(a)

print(lsn(ls))



Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

s = int(input())

ls =[s]
while True:
    if ls[-1] % 2 ==0:
        a = int(ls[-1]/2)
    else:
        a = int(ls[-1]*3 + 1)
    
    if a in ls:
        break
    else:
        ls.append(a)

print(len(ls)+1)