Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math

a, b, c, d =map(int,input().split())

under_a = a -1
cd_gcd = math.gcd(c, d)

b_mul = b - (b//c)-(b//d)+(b//(c*d//cd_gcd))
under_a_mul = under_a - (under_a//c)-(under_a//d)+(under_a//(c*d//cd_gcd))

print(int(b_mul-under_a_mul))

Fixed submission:
import fractions

a, b, c, d =map(int,input().split())

under_a = a -1
cd_gcd = fractions.gcd(c, d)

b_mul = b - (b//c)-(b//d)+(b//(c*d//cd_gcd))
under_a_mul = under_a - (under_a//c)-(under_a//d)+(under_a//(c*d//cd_gcd))

print(int(b_mul-under_a_mul))
Buggy python submission (verdict: Runtime Error):
w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print((w - x) * h,end=" ")
    print(1)
elif x == 0 and y == 0:
    print(w * h / 2,end=" ")
    print(0)
elif x == 0:
    print(max(((h - y) * w) / 2,(y * w) / 2),end=" ")
    print(0)
elif y == 0:
    print(max(((w - x) * h) / 2,(x * h) / 2),end=" ")
    print(0)
elif w / x == h / y:
    print(w * h / 2,end=" ")
    print(0)
elif w / 2 == x:
    print(x * h,end=" ")
    print(0)
elif h / 2 == y:
    print(w * y,end=" ")
    print(0)
else:
    print(max(w * y,x * h,((w-x)*(h-y))/2,end=" "))
    print(0)

Fixed submission:
w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print(w * h / 2, 1)
else:
    print(w * h / 2, 0)

Buggy python submission (verdict: Runtime Error):
w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print((w - x) * h,end=" ")
    print(1)
elif x == 0 and y == 0:
    print(w * h / 2,end=" ")
    print(0)
elif x == 0:
    print(max(((h - y) * w) / 2,(y * w) / 2),end=" ")
    print(0)
elif y == 0:
    print(max(((w - x) * h) / 2,(x * h) / 2),end=" ")
    print(0)
elif w / x == h / y:
    print(w * h / 2,end=" ")
    print(0)
elif w / 2 == x:
    print(x * h,end=" ")
    print(0)
elif h / 2 == y:
    print(w * y,end=" ")
    print(0)
else:
    print(max(w * y,x * h,((w-x)*(h-y))/2,end=" ")
    print(0)

Fixed submission:
w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print(w * h / 2, 1)
else:
    print(w * h / 2, 0)

Buggy python submission (verdict: Runtime Error):
w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print((w - x) * h,end=" ")
    print(1)
elif w / x == h / y:
    print(w * h / 2,end=" ")
    print(0)
elif w / 2 == x:
    print(x * h,end=" ")
    print(0)
elif h / 2 == y:
    print(w * y,end=" ")
    print(0)
else:
    print(max(w * y,x * h),end=" ")
    print(0)

Fixed submission:
w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print(w * h / 2, 1)
else:
    print(w * h / 2, 0)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(min(min(a+b,b+c),a+c)

Fixed submission:
a, b, c = map(int, input().split())
print(min(min(a+b,b+c),a+c))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
max_l,min_r=0,10**9

for i in li:
    max_l = max(max_l,li[0])
    min_r = min(min_r,li[1])
print(min_r-max_l+1)

Fixed submission:
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
max_l,min_r=0,10**9

for i in li:
    max_l = max(max_l,i[0])
    min_r = min(min_r,i[1])
if min_r >= max_l:
    print(min_r-max_l+1)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
cnt = ()
ans=[]

for j in li:
    cnt.add(set(num for num in range(j[0],j[1]+1)))

ans = cnt[0]
for k in range(len(cnt)-1):
    ans = ans & cnt[k+1]
print(len(ans))


Fixed submission:
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
max_l,min_r=0,10**9

for i in li:
    max_l = max(max_l,i[0])
    min_r = min(min_r,i[1])
if min_r >= max_l:
    print(min_r-max_l+1)
else:
  print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
cnt = []
ans=[]

for j in li:
    cnt.append(set(num for num in range(j[0],j[1]+1)))

ans = cnt[0]
for k in range(len(cnt)-1):
    ans = ans & cnt[k+1]
print(len(ans))


Fixed submission:
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
max_l,min_r=0,10**9

for i in li:
    max_l = max(max_l,i[0])
    min_r = min(min_r,i[1])
if min_r >= max_l:
    print(min_r-max_l+1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
a, b , c = map(int, input().split())

if a > c > c or a < c < b:
    print("YES)
else:
    print("No")

Fixed submission:
a, b , c = map(int, input().split())

if a > c > b or a < c < b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
s = [int(i) for i in list(input())]
ans, cnt = 0, 0

for _ in range(len(s) // 2):
    for i in range(len(s) - 1):
        try:
            if s[i] + s[i + 1] == 1:
                del s[i:i + 2]
                cnt += 2
        except IndexError:
            break
    if ans == cnt:
        break
    else:
        ans = cnt

print(ans)


Fixed submission:
s = [int(i) for i in list(input())]

print(2 * min(s.count(1), s.count(0)))

Buggy python submission (verdict: Time Limit Exceeded):
s = [int(i) for i in list(input())]
ans = 0

for _ in range(len(s) // 2):
    for i in range(len(s) - 1):
        try:
            if s[i] + s[i + 1] == 1:
                del s[i:i + 2]
                ans += 2
        except IndexError:
            break
print(ans)


Fixed submission:
s = [int(i) for i in list(input())]

print(2 * min(s.count(1), s.count(0)))

Buggy python submission (verdict: Time Limit Exceeded):
s = [int(i) for i in list(input())]
l = len(s)
ans = 0

for _ in range(l//2):
    for i in range(l-1):
        try:
            if s[i] + s[i+1] == 1:
                del s[i:i+2]
                ans += 2
        except IndexError:
                break
print(ans)

Fixed submission:
s = [int(i) for i in list(input())]

print(2 * min(s.count(1), s.count(0)))
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
l = len(s)
ans = 0
for i in range(l):
    if s[i] == "W":
        ans += s[:i].count("B")
print(ans)

Fixed submission:
s = list(input())
ans = 0
cnt =0
for i in s:
    if i == "B":
        cnt += 1
    else:
        ans += cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
input_num = input()

if input_num != 1:
    a = int(input())
    b = int(input())
    print(a + b)
else:
    print('Hello World')

Fixed submission:
input_num = input()

if input_num == '1':
    print('Hello World')

else:
    a = int(input())
    b = int(input())
    print(a + b)
Buggy python submission (verdict: Runtime Error):
s = list(map(int, list(input())))
k = int(input())

if s[0] == 1:
    print(s[1])
else:
    print(s[0])


Fixed submission:
s = list(map(int, list(input())))
k = int(input())
ans = 1

if len(s) <= k:
    for i in s:
        if i != 1:
            ans = i
            break
else:
    for i in range(0,k):
        if s[i] != 1:
            ans = s[i]
            break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans, cnt = 0, 0
b = True

while b:
    cnt = 0
    for i in range(len(a)):
        if cnt == 0:
            if a[i] % 2 == 0:
                a[i] = a[i] // 2
                cnt = 1
            else:
                a[i] = a[i] * 3
        else:
            a[i] = a[i] * 3
    if cnt == 1:
        ans += 1
    else:
        b = False
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 0

for i in a:
    while i % 2 == 0:
        i //= 2
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from itertools import product
s = list(input())
n = len(s)

pattern = list(product(['+', ''], repeat=n-1))

for i in range(2 ** (n-1)):
    formula = s[0]
    for j, k in zip(pattern[i], s[1:]):
        formula += (j + k)
    if eval(formula) == 7:
        print("{}=7".format(formula))
        break


Fixed submission:
from itertools import product
s = list(input())
n = len(s)

pattern = list(product(['+', '-'], repeat=n-1))

for i in range(2 ** (n-1)):
    formula = s[0]
    for j, k in zip(pattern[i], s[1:]):
        formula += (j + k)
    if eval(formula) == 7:
        print("{}=7".format(formula))
        break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
s = set(l)
ans = 0

for i in s:
    ans = max(l.count(i-1) + l.count(i) + l.count(i+1), ans)

print(ans)

Fixed submission:
from collections import Counter

n = int(input())
l = list(map(int, input().split()))
c = Counter(l)
s = set(l)
ans = 0

for i in s:
    ans = max(c[i-1] + c[i] + c[i+1], ans)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
ans = 0

for i in range(min(l), max(l)+1):
    ans = max(l.count(i-1) + l.count(i) + l.count(i+1), ans)

print(ans)

Fixed submission:
from collections import Counter

n = int(input())
l = list(map(int, input().split()))
c = Counter(l)
s = set(l)
ans = 0

for i in s:
    ans = max(c[i-1] + c[i] + c[i+1], ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
cnt=0
if a==b==c and a%2==0:
    cnt = -1
    break
elif:
    for i in range(100):
        if a%2==0 and b%2==0 and c%2==10:
            t_a = b//2 + c//2
            t_b = a//2 + c//2
            t_c = a//2 + b//2
            a,b,c = t_a,t_b,t_c
            cnt+=1
        else:
            break
print(cnt)

Fixed submission:
a,b,c = map(int,input().split())
cnt=0
if a==b==c and a%2==0:
    cnt = -1
else:
    for i in range(100):
        if a%2==0 and b%2==0 and c%2==0:
            t_a = b//2 + c//2
            t_b = a//2 + c//2
            t_c = a//2 + b//2
            a,b,c = t_a,t_b,t_c
            cnt+=1
        else:
            break
print(cnt)
Buggy python submission (verdict: Runtime Error):
def main():

    a = int(input())
    b = int(input())

    if a > b:
        print("GREATER")
    elif a = b:
        print("EQUAL")
    else:
        print("LESS")

main()

Fixed submission:
def main():

    a = int(input())
    b = int(input())

    if a > b:
        print("GREATER")
    elif a == b:
        print("EQUAL")
    else:
        print("LESS")

main()
Buggy python submission (verdict: Runtime Error):
o = list(input())
e = list(input())
ans = []

for i in range(len(o)):
    ans = ans+ [o[i],e[i]]
print(*ans,sep="")

Fixed submission:
o = list(input())
e = list(input())
ans = []

if len(o) != len(e):
    e += [""]

for i in range(len(o)):
    ans += [o[i],e[i]]
print(*ans,sep="")

Buggy python submission (verdict: Runtime Error):
o = list(input())
e = list(input())
ans = []

for i in range(len(o)):
    ans += [o[i],e[i]]
print(*ans,sep="")

Fixed submission:
o = list(input())
e = list(input())
ans = []

if len(o) != len(e):
    e += [""]

for i in range(len(o)):
    ans += [o[i],e[i]]
print(*ans,sep="")
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())
li = [input() for _ in range(h)]

for i in li:
    print(i,i,sep="\n")***.

Fixed submission:
h,w = map(int,input().split())
li = [input() for _ in range(h)]

for i in li:
    print(i,i,sep="\n")
Buggy python submission (verdict: Time Limit Exceeded):
import collections

n = int(input())
a = list(map(int, input().split()))
l = []
ans = 0

for i in range(n):
    if {i+1, a[i]} in l:
        ans += 1
    else:
        l.append({i+1, a[i]})

print(ans)


Fixed submission:
import collections

n = int(input())
a = list(map(int, input().split()))
ans = 0

for i in range(n):
    if i+1 == a[a[i]-1]:
        ans += 1

print(ans//2)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

ans = 1
for i in range(n):
    ans *= a[i]
if ans > pow(10, 18):
    print(-1)
else:
    print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

ans = 1
a.sort()
for i in range(n):
    ans *= a[i]
    #print(ans)
    if ans > pow(10, 18):
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
a,b,n = map(int,input().split())

ans = 0
tmp = min(b, n)
for x in range(int(pow(n, 0.5)) + 1, n+1):
    #print(x)
    tmp1 = (a * x) // b - (a * (x // b))
    if tmp1 >= ans:
        ans = tmp1
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
a,b,n = map(int,input().split())
"""
ans = 0
tmp = min(b, n)
for x in range(int(pow(n, 0.5)) + 1, n+1):
    #print(x)
    tmp1 = (a * x) // b - (a * (x // b))
    if tmp1 >= ans:
        ans = tmp1
print(ans)
"""

x = min(b-1, n)
#print(x)
ans = (a * x) // b - (a * (x // b))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import collections
s = (input())

"""
n = len(s)
ans = 0
for i in range(n-4):
    for j in range(i+4,n+1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)
"""

n = len(s)
ans = 0
l = 0
#r = l
num = int(s)

tmp = [0 for _ in range(n+1)]
tmp1 = 0
for i in range(0,n):
    tmp1 += (int(s[n-i-1]) * pow(10, i))
    tmp[i+1] = tmp1 % 2019
#print(tmp)

c = collections.Counter(tmp)
#print(c)
for i in range(0, 2020):
    if c[i] > 0:
        ans += ((2 * c[i] - 1) // 2)
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import collections
s = (input())

"""
n = len(s)
ans = 0
for i in range(n-4):
    for j in range(i+4,n+1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)
"""

n = len(s)
ans = 0
l = 0
#r = l
num = int(s)

tmp = [0 for _ in range(n+1)]
ten = [0 for _ in range(n)]
tmp1 = 0
val = 1
for i in range(0,n):
    ten[i] = val
    tmp1 += (int(s[n-i-1]) * val)
    tmp[i+1] = tmp1 % 2019
    val = (val * 10) % 2019
#print(tmp)

c = collections.Counter(tmp)
#print(c)
for i in range(0, 2020):
    a = c[i]
    if a > 0:
        ans += ((a * (a - 1)) // 2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
s = (input())

n = len(s)
ans = 0
for i in range(n-4):
    for j in range(i+4,n+1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import collections
s = (input())

"""
n = len(s)
ans = 0
for i in range(n-4):
    for j in range(i+4,n+1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)
"""

n = len(s)
ans = 0
l = 0
#r = l
num = int(s)

tmp = [0 for _ in range(n+1)]
ten = [0 for _ in range(n)]
tmp1 = 0
val = 1
for i in range(0,n):
    ten[i] = val
    tmp1 += (int(s[n-i-1]) * val)
    tmp[i+1] = tmp1 % 2019
    val = (val * 10) % 2019
#print(tmp)

c = collections.Counter(tmp)
#print(c)
for i in range(0, 2020):
    a = c[i]
    if a > 0:
        ans += ((a * (a - 1)) // 2)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import collections
n = int(input())
s = list(input())

c = collections.Counter(s)
total = c['R'] * c['G'] * c['B']
tmp = 0
#print(total)
for i in range(1, n - 1):
    for j in range(i + 1, n):
        k = 2 * j - i
        if i <= k <= n:
            #print(i, j, k)
            if s[i-1] != s[j-1] and s[i-1] != s[k-1] and s[j-1] != s[k-1]:
                tmp += 1
print(total - tmp)

Fixed submission:
# -*- coding: utf-8 -*-
import collections
n = int(input())
s = list(input())

c = collections.Counter(s)
total = c['R'] * c['G'] * c['B']
tmp = 0
#print(total)
for i in range(1, n - 1):
    for j in range(i + 1, n):
        k = 2 * j - i
        if i <= k <= n:
            #print(i, j, k)
            if s[i-1] != s[j-1] and s[i-1] != s[k-1] and s[j-1] != s[k-1]:
                tmp += 1
print(total - tmp)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
s = input()
#a = [int(i) for i in input().split()]

ans = 0
for k in range(3, n + 1):
    for j in range(2, k):
        for i in range(1, j):
            if s[i-1] != s[j-1] and s[i-1] != s[k-1] and s[j-1] != s[k-1] and j - i != k - j:
                ans += 1
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import collections
n = int(input())
s = list(input())

c = collections.Counter(s)
total = c['R'] * c['G'] * c['B']
tmp = 0
#print(total)
for i in range(1, n - 1):
    for j in range(i + 1, n):
        k = 2 * j - i
        if i <= k <= n:
            #print(i, j, k)
            if s[i-1] != s[j-1] and s[i-1] != s[k-1] and s[j-1] != s[k-1]:
                tmp += 1
print(total - tmp)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
s = input()
#a = [int(i) for i in input().split()]

ans = 0
for k in range(3, n + 1):
    for j in range(2, k):
        for i in range(1, j):
            if s[i-1] != s[j-1] and s[i-1] != s[k-1] and s[j-1] != s[k-1] and j - i != k - j:
                ans += 1
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
import collections
n = int(input())
s = list(input())

c = collections.Counter(s)
total = c['R'] * c['G'] * c['B']
tmp = 0
#print(total)
for i in range(1, n - 1):
    for j in range(i + 1, n):
        k = 2 * j - i
        if i <= k <= n:
            #print(i, j, k)
            if s[i-1] != s[j-1] and s[i-1] != s[k-1] and s[j-1] != s[k-1]:
                tmp += 1
print(total - tmp)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
h, w = map(int,input().split())

if h % 2 == 0:
    tmp1 = h // 2
    ans = tmp1 * w
else:
    tmp1 = h // 2
    #print(tmp1 * w)
    #print(w % 2)
    if w % 2 == 0:
        ans = (tmp1 * wl) + (w // 2)
    else:
        ans = (tmp1 * w) + (w // 2 + 1)
print(ans)


Fixed submission:
h, w = map(int,input().split())

if w == 1 or h == 1:
    print(1)
    exit()

ans = (w // 2) * h
if w % 2 == 1:
    if h % 2 == 0:
        ans += h // 2
    else:
        ans += h // 2 + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
ans = sys.maxint

n = int(input())
x = [int(i) for i in input().split()]


tmp = 0
for i in range(-1000, 1001): #iは集会を開く場所
    for j in range(n):
        tmp += pow(x[j] - i, 2)
    if ans > tmp:
        ans = tmp
    tmp = 0
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
x = [int(i) for i in input().split()]

ans = 2147483647
tmp = 0
for i in range(-1000, 1001): #iは集会を開く場所
    for j in range(n):
        tmp += pow(x[j] - i, 2)
    if ans > tmp:
        ans = tmp
    tmp = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

h.sort()
tmp = 0
for i in range(n-k, n):
    tmp += h[i]
if k >= n:
    ans = 0
else:
    h.sort()
    tmp = 0
    for i in range(n-k, n):
        tmp += h[i]
    ans = (sum(h) - tmp)
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

if k >= n:
    ans = 0
else:
    h.sort()
    tmp = 0
    for i in range(n-k, n):
        tmp += h[i]
    ans = (sum(h) - tmp)
print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

h.sort()
tmp = 0
for i in range(n-k, n):
    tmp += h[i]
if k >= n:
    ans = 0
else:
    ans = (sum(h) - tmp)
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

if k >= n:
    ans = 0
else:
    h.sort()
    tmp = 0
    for i in range(n-k, n):
        tmp += h[i]
    ans = (sum(h) - tmp)
print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

tmp = 0
for i in range(n-k, n):
    tmp += h[i]
if k >= n:
    ans = 0
else:
    ans = (sum(h) - tmp)
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

if k >= n:
    ans = 0
else:
    h.sort()
    tmp = 0
    for i in range(n-k, n):
        tmp += h[i]
    ans = (sum(h) - tmp)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]

ans = 1
tmp = [p[0]]
for i in range(1, n):
    tmp.append(p[i])
    tmp.sort()
    if p[i] <= tmp[0]:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

ans = 1
tmp = p[0]
for i in range(1, n):
    if tmp >= p[i]:
        ans += 1
        tmp = p[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
p = [int(i) for i in input().split()]

"""
ans = 0
for i in range(n):
    tmp = 0
    for j in range(i):
        if p[j] >= p[i]:
            tmp += 1
    if tmp == i:
        ans += 1
print(ans)
"""

"""
ans = 1
for i in range(1, n):
    tmp = []
    for j in range(i):
        tmp.append(p[j])
    tmp.sort()
    #print(tmp)
    if p[i] <= tmp[0]:
        ans += 1
print(ans)
"""

ans = 1
tmp = [p[0]]
for i in range(1, n):
    tmp.append(p[i])
    tmp.sort()
    if p[i] <= tmp[0]:
        ans += 1
print(ans)


Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

ans = 1
tmp = p[0]
for i in range(1, n):
    if tmp >= p[i]:
        ans += 1
        tmp = p[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
p = [int(i) for i in input().split()]
"""
ans = 0
for i in range(n):
    tmp = 0
    for j in range(i):
        if p[j] >= p[i]:
            tmp += 1
    if tmp == i:
        ans += 1
print(ans)
"""
ans = 1
for i in range(1, n):
    tmp = []
    for j in range(i):
        tmp.append(p[j])
    tmp.sort()
    #print(tmp)
    if p[i] <= tmp[0]:
        ans += 1
print(ans)


Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

ans = 1
tmp = p[0]
for i in range(1, n):
    if tmp >= p[i]:
        ans += 1
        tmp = p[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
p = [int(i) for i in input().split()]

ans = 0
for i in range(n):
    tmp = 0
    for j in range(i):
        if p[j] >= p[i]:
            tmp += 1
    if tmp == i:
        ans += 1
print(ans)


Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

ans = 1
tmp = p[0]
for i in range(1, n):
    if tmp >= p[i]:
        ans += 1
        tmp = p[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
p = [int(i) for i in input().split()]

ans = 0
for i in range(n):
    tmp = 0
    for j in range(i):
        if p[j] >= p[i]:
            tmp += 1
    if tmp == i:
        ans += 1
print(ans)


Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

ans = 1
tmp = p[0]
for i in range(1, n):
    if tmp >= p[i]:
        ans += 1
        tmp = p[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
a,b,k = map(int,input().split())

for i in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
print(a,b)


Fixed submission:
# -*- coding: utf-8 -*-
a,b,k = map(int,input().split())
"""
for i in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
print(a,b)
"""

if k <= a and a >= 1:
    a = a - k
elif k <= a + b and b >= 1:
    c = a
    a = 0
    b = b - (k - c)
else:
    a = 0
    b = 0
print(a, b)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
a,b = map(int,input().split())

ans = a * b // math.gcd(a,b)
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
a,b = map(int,input().split())

def gcd(a,b):
    x = max(a,b)
    y = min(a,b)
    if x % y == 0:
        return y
    else:
        while True:
            if x % y != 0:
                z = x % y
                x = y
                y = z
            else:
                break
        return z


def lcm(a,b):
    return a * b // gcd(a,b)

ans = lcm(a,b)
print(ans)