Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x,y,z = input().split
print(z,x,y)



Fixed submission:
x,y,z = input().split(" ")
print(z,x,y)

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


Fixed submission:
x,y,z = input().split(" ")
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x,y,z = map(int,input().split)
new_list = [z,x,y]
print((" ").join(new_list))

Fixed submission:
x,y,z = input().split(" ")
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x, y, z = [int(i) for i in input().split()]
x, y = y, x
x, z = z, x
print(f'{x} {y} {z}')

Fixed submission:
x, y, z = [int(i) for i in input().split()]
x, y = y, x
x, z = z, x
print(x, y, z)

Buggy python submission (verdict: Runtime Error):
x, y, z = [int(i) for i in input().split()]
x, y = y, x
x, z = z, x
print(f'{x} {y} {z}'

Fixed submission:
x, y, z = [int(i) for i in input().split()]
x, y = y, x
x, z = z, x
print(x, y, z)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = [int(i) for i in input().split()]
while abs(n - k) < n:
        n = abs(n-k)
print(n)

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

if n >= k:
    result = min(n % k, k - (n % k))
elif 2 * n >= k > n:
    n = abs(k - n)
    result = n
else:
    result = n

print(result)

Buggy python submission (verdict: Runtime Error):
n, k = [int(i) for i in input().split()]

result = min(n % k, k - (n % k), k % n, n - (k % n))

print(result)

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

if n >= k:
    result = min(n % k, k - (n % k))
elif 2 * n >= k > n:
    n = abs(k - n)
    result = n
else:
    result = n

print(result)

Buggy python submission (verdict: Runtime Error):
n, k = [int(i) for i in input().split()]
result = n % abs(n - k)
print(result)


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

if n >= k:
    result = min(n % k, k - (n % k))
elif 2 * n >= k > n:
    n = abs(k - n)
    result = n
else:
    result = n

print(result)

Buggy python submission (verdict: Runtime Error):
n, k = [int(i) for i in input().split()]
while true:
    if abs(n - k) < n:
        n = abs(n - k)
    else:
        break
print(n)


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

if n >= k:
    result = min(n % k, k - (n % k))
elif 2 * n >= k > n:
    n = abs(k - n)
    result = n
else:
    result = n

print(result)

Buggy python submission (verdict: Runtime Error):
n, k = [int(i) for i in input().split()]
for range(n):
	if abs(n - k) < n:
        n = abs(n-k)
print(n)


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

if n >= k:
    result = min(n % k, k - (n % k))
elif 2 * n >= k > n:
    n = abs(k - n)
    result = n
else:
    result = n

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = [int(i) for i in input().split()]
while abs(n - k) < n:
        n = abs(n-k)
print(n)


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

if n >= k:
    result = min(n % k, k - (n % k))
elif 2 * n >= k > n:
    n = abs(k - n)
    result = n
else:
    result = n

print(result)
Buggy python submission (verdict: Time Limit Exceeded):

k = int(input())


def lunlunfinder(k):
    l = [int(x) for x in list(str(k))]
    status = 0
    for i in range(len(l) - 1):
        if abs(l[i] - l[i + 1])  <= 1:
            continue
        else:
            status = 1
            break

    if status == 1:
        return False
    else:
        return True


lunlunlist = []
i = 1

while len(lunlunlist) < k:
    if lunlunfinder(i) == True:
        lunlunlist.append(i)
    i += 1

print(lunlunlist[k - 1])

Fixed submission:
def last_number(n):
    if n == 0:
        return [0, 1]
    elif n == 9:
        return [8, 9]
    else:
        return [n-1, n, n+1]

k = int(input())
lun = {1, 2, 3, 4, 5, 6, 7, 8, 9}
temp = set()
while len(lun) < k:
    for i in lun:
        last = int(str(i)[-1])
        for j in last_number(last):
            temp.add(int(str(i) + str(j)))
    lun.update(temp)
    temp = set()
answer = sorted(list(lun))
print(answer[k - 1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())


def tester(n, k):
    temp = n
    while temp % k == 0:
        temp /= k

    if temp % k == 1:
        return True
    else:
        return False

answer= []

for i in range(2, N + 1):
    if tester(N, i):
        answer.append(i)

print(len(answer))

Fixed submission:
n = int(input())

def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table


def tester(n, k):
    if k == 1:
        return False

    temp = n
    while temp % k == 0:
        temp /= k

    if temp % k == 1:
        return True
    else:
        return False

answer = []
for i in (divisor(n - 1) + divisor(n)):
    if tester(n, i):
        answer.append(i)

print(len(answer))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(i) for i in input().split()]

ans = 0
for i in range(n):
    j = l.count(i)
    ans += int(j * (j - 1) / 2)

for i in range(n):
    ans_i = 0
    j = l.count(l[i])
    print(ans - j + 1)
    

Fixed submission:
from collections import Counter

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

S = Counter(l)

ans = 0
for i in S.values():
    ans += int(i * (i - 1) / 2)

for i in range(n):
    val = S[l[i]]
    print(ans - val + 1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(i) for i in input().split()]


ans = 0
for i in range(n):
    j = l.count(i)
    ans += int(j * (j - 1) / 2)

for i in range(n):
    ans_i = 0
    j = l.count(l[i])
    print(ans - j + 1)


for i in range(3, n + 1):
    l.count(i)


Fixed submission:
from collections import Counter

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

S = Counter(l)

ans = 0
for i in S.values():
    ans += int(i * (i - 1) / 2)

for i in range(n):
    val = S[l[i]]
    print(ans - val + 1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(i) for i in input().split()]


ans = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        if l[j] == l[i]:
            ans += 1

for i in range(n):
    ans_i = 0
    for j in range(n):
        if j != i:
            if l[i] == l[j]:
                ans_i += 1
    print(ans - ans_i)

Fixed submission:
from collections import Counter

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

S = Counter(l)

ans = 0
for i in S.values():
    ans += int(i * (i - 1) / 2)

for i in range(n):
    val = S[l[i]]
    print(ans - val + 1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(i) for i in input().split()]


ans = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        if l[j] == l[i]:
            ans += 1

for i in range(n):
    ans_i = 0
    for j in range(n):
        if j != i:
            if l[i] == l[j]:
                ans_i += 1
    print(ans - ans_i)

Fixed submission:
from collections import Counter

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

S = Counter(l)

ans = 0
for i in S.values():
    ans += int(i * (i - 1) / 2)

for i in range(n):
    val = S[l[i]]
    print(ans - val + 1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(i) for i in input().split()]
for i in range(n):
    answer = 0
    for j in range(n - 1):
        ans = 0
        if j == i:
            continue
        for k in range(j + 1, n):
            if k != i:
                if l[k] == l[j]:
                    ans += 1
        answer += ans
    print(answer)

Fixed submission:
from collections import Counter

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

S = Counter(l)

ans = 0
for i in S.values():
    ans += int(i * (i - 1) / 2)

for i in range(n):
    val = S[l[i]]
    print(ans - val + 1)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = [int(i) for i in input().split()]
l = []

for x in range(K + 1):
    if S - x >= 0:
        for y in range(K + 1):
            if K >= S - x - y >= 0:
                z = S - x - y
                l.append((x, y, z))


print(len(l))

Fixed submission:
K, S = [int(i) for i in input().split()]
ans = 0

for x in range(K + 1):
    if S - x >= 0:
        for y in range(K + 1):
            if K >= S - x - y >= 0:
                ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = list(map(int, input()))
print(c, a, b)

Fixed submission:
a, b, c = list(map(int, input().split()))
print(c, a, b)
Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
num_array = list(map(int, input().split()))

max_exp = 0
for i in range(len(num_array) - M + 1):
    tmp = sum(processed[i:i+M])
    if max_exp < tmp:
        max_exp = tmp

print((max_exp+1)*3/2) 

Fixed submission:
import numpy as np

N, M = list(map(int, input().split()))
num_array = np.cumsum(list(map(lambda x: (x+1)/2, list(map(int, input().split())))))

max_exp = num_array[M-1]
for i in range(len(num_array)-M):
    tmp = num_array[i+M] - num_array[i]
    if max_exp < tmp:
        max_exp = tmp

print(max_exp)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
num_array = list(map(int, input().split()))

processed = list(map(lambda x: (1+x)/2, num_array))

max_exp = 0
for i in range(len(num_array) - M + 1):
    tmp = sum(processed[i:i+M])
    if max_exp < tmp:
        max_exp = tmp

print(max_exp) 

Fixed submission:
import numpy as np

N, M = list(map(int, input().split()))
num_array = np.cumsum(list(map(lambda x: (x+1)/2, list(map(int, input().split())))))

max_exp = num_array[M-1]
for i in range(len(num_array)-M):
    tmp = num_array[i+M] - num_array[i]
    if max_exp < tmp:
        max_exp = tmp

print(max_exp)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
num_array = list(map(int, input().split()))

processed = list(map(lambda x: (1+x)/2, num_array))

expected = []
for i in range(len(num_array) - M + 1):
    expected.append(sum(processed[i:i+M]))

print(max(expected)) 

Fixed submission:
import numpy as np

N, M = list(map(int, input().split()))
num_array = np.cumsum(list(map(lambda x: (x+1)/2, list(map(int, input().split())))))

max_exp = num_array[M-1]
for i in range(len(num_array)-M):
    tmp = num_array[i+M] - num_array[i]
    if max_exp < tmp:
        max_exp = tmp

print(max_exp)
Buggy python submission (verdict: Runtime Error):
import math
input_line = input().split()
H, A = map(int, input_line())
print(math.ceil(H/A))


Fixed submission:
import math
input_line = input().split()
H, A = map(int, input_line)
print(math.ceil(H/A))
Buggy python submission (verdict: Runtime Error):
A, B = B, A
A, C = C, A

print(f'{A} {B} {C}')



Fixed submission:
A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print('{} {} {}'.format(A, B, C))

Buggy python submission (verdict: Runtime Error):
A,B,C = input()
A, B = B, A
A, C = C, A

print(f'{A} {B} {C}')



Fixed submission:
A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print('{} {} {}'.format(A, B, C))

Buggy python submission (verdict: Runtime Error):
A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print(f'{A} {B} {C}')



Fixed submission:
A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print('{} {} {}'.format(A, B, C))

Buggy python submission (verdict: Runtime Error):
A,B,C = [int(i) for i in input().split(' ')]


temp = A
A = B
B = temp

temp = A
A = C
C = temp

print(f'{A} {B} {C}')



Fixed submission:
A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print('{} {} {}'.format(A, B, C))

Buggy python submission (verdict: Runtime Error):
A,B,C = [int(i) for i in input().split(' ')]

temp = A
A = B
B = temp

temp = A
A = C
C = temp

print(f'{A} {B} {C}')

Fixed submission:
A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print('{} {} {}'.format(A, B, C))

Buggy python submission (verdict: Runtime Error):
A,B,C = [int(i) for i in input().split(' ')]

temp = A
A = B
B = temp
temp = A
A = C
C = temp

print(f'{A} {B} {C}')

Fixed submission:
A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print('{} {} {}'.format(A, B, C))

Buggy python submission (verdict: Runtime Error):
A , B, C = int(input()).split(' ')
temp = 0
temp = A
A = B
B = temp
temp = A
A = C
C = temp
print(f'{A} {B} {C}')

Fixed submission:
A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print('{} {} {}'.format(A, B, C))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(i) for i in input().split(' ')]

prev = N

if N == 0:
  print( N)
else:
  while True:
    if prev == 0:
      print(prev)
      break
    elif abs(N - K) >= prev:
      print(prev)
      break
    else:
      N = abs(N - K)
      prev = N




Fixed submission:
N, K = [int(i) for i in input().split(' ')]

def res():
  if N == K:
    return 0
  elif N > K:
    return N % K if K - (N % K) > (N % K) else K - (N % K)
  else :
    return abs(N - K) if abs(N - K) < abs(abs(N-K) - K) else abs(abs(N-K) - K)

print(res())

Buggy python submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split(' ')]

prev = N

if N == 0:
  print( N)
else:
  while True:
    if prev == 0:
      print(prev)
      break
    elif abs() >= prev:
      print(prev)
      break
    else
      N = abs()
      prev = N




Fixed submission:
N, K = [int(i) for i in input().split(' ')]

def res():
  if N == K:
    return 0
  elif N > K:
    return N % K if K - (N % K) > (N % K) else K - (N % K)
  else :
    return abs(N - K) if abs(N - K) < abs(abs(N-K) - K) else abs(abs(N-K) - K)

print(res())

Buggy python submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split(' ')]

min_value = 0

count = 0
while True:
  if min_value < abs(N - K):
    count =+ 1
    if count > 1:
	    break
    else:
		N = abs(N - K)
		min_value = N		
  else:
	N = abs(N - K)
	min_value = N
    
print(min_value)	

Fixed submission:
N, K = [int(i) for i in input().split(' ')]

def res():
  if N == K:
    return 0
  elif N > K:
    return N % K if K - (N % K) > (N % K) else K - (N % K)
  else :
    return abs(N - K) if abs(N - K) < abs(abs(N-K) - K) else abs(abs(N-K) - K)

print(res())

Buggy python submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split(' ')]

min1 = 0
prev = 0

while True:
  if prev < abs(N - K):
    break
  else:
    min1 = abs(N - K)
	N = abs(N - K)
	prev = min1


print(prev)
		

Fixed submission:
N, K = [int(i) for i in input().split(' ')]

def res():
  if N == K:
    return 0
  elif N > K:
    return N % K if K - (N % K) > (N % K) else K - (N % K)
  else :
    return abs(N - K) if abs(N - K) < abs(abs(N-K) - K) else abs(abs(N-K) - K)

print(res())

Buggy python submission (verdict: Runtime Error):
N, K [int(i) for i in input().split(' ')]

min = 0
prev = 0

while abs(N - K) > prev:
  min = abs(N - K)
  prev = min

print(min)
		

Fixed submission:
N, K = [int(i) for i in input().split(' ')]

def res():
  if N == K:
    return 0
  elif N > K:
    return N % K if K - (N % K) > (N % K) else K - (N % K)
  else :
    return abs(N - K) if abs(N - K) < abs(abs(N-K) - K) else abs(abs(N-K) - K)

print(res())
Buggy python submission (verdict: Runtime Error):
A, B = [int(i) for i input().split(' ')]
     
def f():
	res = 0
    if A > B and A - 1 > B:
    	res += A + A - 1
    elif B > A and B - 1 > A:
    	res += B + B - 1
    else:
    	res = A + B
    return res
f()

Fixed submission:
A, B = [int(i) for i in input().split(' ')]
     
def f():
    res = 0
    if A > B and A - 1 > B:
        res = A + A - 1
    elif B > A and B - 1 > A:
        res = B + B - 1
    else:
        res = A + B
    return res
print(f())
Buggy python submission (verdict: Runtime Error):
antennas = [int(input()) for i in range(5)]

max_dist = int(input())

coords = {}

for i in range(len(antennas)):
  coords[i] = antennas[i]
flag = 1
for i in range():
  for j in range(i + 1, 5):
    if abs(coords[i] - coords[j]) > max_dist:
      print(':(')
      flag = 0
      break
  if flag == 0:
    break
if flag == 1:
  print('Yay!')
      

Fixed submission:
antennas = [int(input()) for i in range(5)]

max_dist = int(input())

coords = {}

for i in range(len(antennas)):
  coords[i] = antennas[i]
flag = 1
for i in range(5):
  for j in range(i + 1, 5):
    if abs(coords[i] - coords[j]) > max_dist:
      print(':(')
      flag = 0
      break
  if flag == 0:
    break
if flag == 1:
  print('Yay!')

Buggy python submission (verdict: Runtime Error):
antennas = [int(input()) for i in range(5)]

max_dist = int(input())

coords = {}

for i in range(len(antennas)):
  coords[i] = antennas[i]
flag = 1
for i in range():
  for j in range(i + 1, 5):
    if abs(coords[i] - coords[j]) > max_dist:
      print(':(')
      flag = 0
      break
  if flag = 0:
    break
if flag = 1:
  print('Yay!')
      
  

Fixed submission:
antennas = [int(input()) for i in range(5)]

max_dist = int(input())

coords = {}

for i in range(len(antennas)):
  coords[i] = antennas[i]
flag = 1
for i in range(5):
  for j in range(i + 1, 5):
    if abs(coords[i] - coords[j]) > max_dist:
      print(':(')
      flag = 0
      break
  if flag == 0:
    break
if flag == 1:
  print('Yay!')
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List(b-1)
if d < c/4/b:
	print("No")
else:
	print("Yes")

Fixed submission:
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List[b-1]
if d < c/4/b:
	print("No")
else:
	print("Yes")

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List(b-1)
if d < c/4/b;
	print("No")
elif
	print("Yes")

Fixed submission:
a,b = map(int, input().split())
List = list(map(int, input().split()))
c = sum(List)
List = sorted(List)[::-1]
d = List[b-1]
if d < c/4/b:
	print("No")
else:
	print("Yes")
Buggy python submission (verdict: Runtime Error):
a=int(input())
s=o
for i in range(1,a+1,1):
    s+=i
print(s)

Fixed submission:
a=int(input())
s=a*(a+1)/2
print(int(s))

Buggy python submission (verdict: Runtime Error):
a=int(input())
s=o
for i in range(1,a+1,1):
    s+=i
print(s)

Fixed submission:
a=int(input())
s=a*(a+1)/2
print(int(s))
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
A =sorted(A)
if A[0]=5 and A[1]=5 and A[2]=7:
  print("YES")
else:
  print("NO")

Fixed submission:
A = list(map(int, input().split()))
A =sorted(A)
if A[0]==5 and A[1]==5 and A[2]==7:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
if max(A)=7 and mean(A)=5 and min(A)=5:
  print("YES")
else:
  print("NO")

Fixed submission:
A = list(map(int, input().split()))
A =sorted(A)
if A[0]==5 and A[1]==5 and A[2]==7:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if max(a,b,c)=7 and mean(a,b,c)=5 and min(a,b,c)=5:
  print("YES")
else:
  print("NO")

Fixed submission:
A = list(map(int, input().split()))
A =sorted(A)
if A[0]==5 and A[1]==5 and A[2]==7:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
a,b,c=int(input().split())
if max(a,b,c)=7 and mean(a,b,c)=5 and min(a,b,c)=5:
  print("YES")
else:
  print("NO")

Fixed submission:
A = list(map(int, input().split()))
A =sorted(A)
if A[0]==5 and A[1]==5 and A[2]==7:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
if max(a,b,c)=7 and mean(a,b,c)=5 and min(a,b,c)=5:
  print("YES")
else:
  print("NO")

Fixed submission:
A = list(map(int, input().split()))
A =sorted(A)
if A[0]==5 and A[1]==5 and A[2]==7:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

a, b = map(int,input().split(' '))

if b-a < b*0.8:
    i = 1
    while True:
        if a == int(i*0.08) and b == int(i*0.1):
            print(i)
            break
        i += 1
else:
    print(-1)


Fixed submission:
# -*- coding: utf-8 -*-

a, b = map(int,input().split(' '))

for i in range(10000):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        exit()
print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n = int(input())
sl = list(input() for _ in range(n))
sl_set = list(set(sl))
sl_set.sort()

m = 0
l = []
for s in sl_set:
    a = sl.count(s)
    m = max(m, a)
    l.append(a)

m_idx = np.where(np.array(l) == m)
for i in m_idx[0]:
    print(sl_set[i])

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
from collections import Counter

n = int(input())
sl = list(input() for _ in range(n))
sl_dct = Counter(sl)
m = 0
for i in sl_dct.values():
    m = max(m,i)

sl_s =  list(set(sl))
sl_s.sort()
for i in sl_s:
    if sl_dct[i] == m:
        print(i)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

n = int(input())
al = list(map(int, input().split()))

for i in range(n):
    for j in range(i+1, n):
        if al[i] == al[j]:
            print('NO')
            exit()
print('YES')

Fixed submission:
# -*- coding: utf-8 -*-

n = int(input())
al = list(map(int, input().split()))
al.sort()

for i in range(n-1):
    if al[i] == al[i+1]:
        print('NO')
        exit()
print('YES')
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

n = int(input())
pl = list(map(int, input().split()))

ans = 0
for i in range(n):
    mi = min(pl[:i+1])
    if mi == pl[i]:
        ans += 1
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-

n = int(input())
pl = list(map(int, input().split()))

ans = 0
mi = float('inf')
for p in pl:
	if p<mi:
		ans += 1
	mi = min(mi, p)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

n = int(input())
l = sorted(list(map(int, input().split(' '))), reverse = True)

ans = 0
for ai in range(len(l)-2):
    a = l[ai]
    for bj in range(ai+1, len(l)-1):
        b = l[bj]
        for ck in range(bj+1, len(l)):
            c = l[ck]
            if a < b+c:
                ans += 1
            else:
                break

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
from bisect import bisect_left

n = int(input())
l = sorted(list(map(int, input().split(' '))))

ans = 0
for i in range(n-1):
    for j in range(i+1, n):
        t = l[i]+l[j]
        idx = bisect_left(l, t)
        ans += max(0, idx-j-1)

print(ans)