peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
x = int(input())

s = x // 11
t = x % 11
if t > 6:
    print(s * 2 + 2)
else:
    print(s * 2 + 1)
# Judge status: Wrong Answer
import sys
import itertools
N = int(input())
Z = [list(map(int,input().split())) for _ in range(N)]
ans = 0
ZX = sorted(Z,key=lambda x: x[0])
ZY = sorted(Z,key=lambda x: x[1])
ZZ = [ZX[0],ZX[-1],ZY[0],ZY[-1]]
for x in itertools.combinations(ZZ,2):
  ans = max(ans, abs(x[0][0]-x[1][0])+abs(x[0][1]-x[1][1]))

print(ans)
# Judge status: Accepted
D = int(input())

A = ["Christmas"]

for i in range(25 - D):
  A.append("Eve")

S = ' '.join(A)

print(S)
# Judge status: Accepted
x,y = map(int,input().split())
# al = list(map(int,input().split()))

a =[1,3,5,7,8,10,12]
b = [4, 6,9,11]
c = [2]

if x in a and y in a:
    print('Yes')
elif x in b and y in b:
    print('Yes')
elif x in c and y in c:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
a, c = sorted([a, c])

print('Yes' if a <= c and c <= b else "No")
# Judge status: Accepted
a,b = map(int,input().split())
if a > 0:
    print("Positive")
    
elif a <= 0 and 0 <= b:
    print("Zero")
    
else:
    if a % 2 == b % 2:
        print("Negative")
   
    else:
        print("Positive")
# Judge status: Wrong Answer
sosuu = [2]
A = int(input())
for L in range(3, A+1, 2): # 2 以外の素数は奇数なので
    for L2 in sosuu:
        if L % L2 == 0:
            break # 素数でないことがわかったらそれ以上ループする必要はない
    else: # break で抜けることがなかったら L は素数（Python 特有の制御構文）
        sosuu.append(L)

ans=0
for i in sosuu:
    if A%i==0:
        ans+=1
        A/=i
print(ans)
# Judge status: Wrong Answer
D,T,S=map(int,input().split())
if D/S<=15:
    print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
f=lambda:map(int,input().split())
N,M=f()
q=[list(f()) for _ in [0]*M]
res=-1
for i in range(10**(N-1),10**N):
    for j in range(M):
        if str(i)[q[j][0]-1]!=str(q[j][1]):
            break
    else:
        res=i
        break
print(res)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

_in = input()

# if True:
#     print(_in)
# else:
#     print(_in)

print(_in[1:3])
# Judge status: Accepted
A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = min(a) + min(b)

for i in range(M):
    x,y,d = map(int,input().split())
    c = min(c,a[x-1]+b[y-1]-d)

print(c)
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]
cnt = Counter(s)
ans = 0
for k, v in cnt.items():
    if k in t:
        pass
    else:
        ans = max(ans, v)
print(ans)
# Judge status: Accepted
A,B,C,X = [int(input()) for _ in range(4)]
 
ans = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a*500+b*100+c*50 == X:
        ans += 1
print(ans)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    n, a, b = inl()
    if (b - a) % 2 == 0:
        return (b - a) // 2

    k = min(a - 1, n - b)
    return k + 1 + (b - a) // 2


print(solve())
# Judge status: Accepted
n,m = map(int,input().split())
l = list(map(int,input().split()))
d = {}
each = []
for i in range(m):
	sou,des = map(int,input().split())
	each.append(sou)
	each.append(des)
	if sou not in d:
		d[sou] = [des]
	else:
		d[sou].append(des)
	if des not in d:
		d[des] = [sou]
	else:
		d[des].append(sou)
#print(d)
#print(dic)
count = 0
for i in d:
	flag = True
	for j in d[i]:
		if l[i-1] <= l[j-1]:
			flag = False
			break
	if flag:
		count += 1
count += (n - len(set(each)))
print(count)
# Judge status: Wrong Answer
n = int(input())
total = 0
for i in range(n+1):
  if (len(str(i))%2 != 0):
    total += 1
print(total)
# Judge status: Accepted
n = int(input())
l = sorted(map(int, input().split()))
cnt = 0
m = n-1
g = []
for i in range(n):
  for j in range(i):
    g.append(l[i]+l[j])
g = sorted(g,reverse = True)
for i in g:
  while l[m] >= i:
    m-=1
  cnt += n-m-1
print(n*(n-1)*(n-2)//6-cnt)
# Judge status: Accepted
a,b = map(int,input().split())
c = -(-a//(b*2+1))
print(c)
# Judge status: Wrong Answer
import heapq
n = int(raw_input())
heap = [map(int, raw_input().split(' '))[::-1] for _ in range(n)]
heapq.heapify(heap)

def f(heap):
	t = 0
	while(heap):
		nd,ct = heapq.heappop(heap)
		gap = nd - t
		while(heap and heap[0][0] == nd):
			u,v = heapq.heappop(heap) 
			ct += v
			gap -= v
		if gap < 0: return False
		while(heap and heap[0][1] <= gap):
			_,v = heapq.heappop(heap)
			gap -= v
			t += v
	return True
print 'Yes' if f(heap) else 'No'
# Judge status: Accepted
N = int(input())
S = N // 2

if N % 2 == 0:
    print(S)
elif N % 2 == 1:
    print(S+1)
# Judge status: Wrong Answer
N,M = map(int,input().split())
X = sorted(list(map(int,input().split())))
B=[]

#print(X)
for i in range(M-1):
    B.append(abs(abs(X[i+1])-abs(X[i])))

B.sort()
#print(B)


print(sum(B[:-(N-1)]))
# Judge status: Wrong Answer
N, M = map(int, input().split())
if N >= M: print('Yes')
else: print('No')
# Judge status: Accepted
n=int(input())
res=n*(n-1)//2
print(res)
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

dist = abs(B-A)
spd = V-W
ans = "YES"

if spd*T < dist:
    ans = "NO"

print(ans)
# Judge status: Accepted
a = [int(input()) for i in range(5)]
#10で割った余りが0でないもののうち、余りが一番小さい品を最後に注文するのが最も早くなる
last = -1
for i in range(5):
  if a[i] % 10 != 0:
    last = i
  break

if last == -1:
  last = 0
else:
  for i in range(5):
    if a[i] % 10 < a[last] % 10 and a[i] % 10 != 0:
      last = i


ans = 0
for i in range(5):
  if i == last:
    continue

  ans += a[i]
  if ans % 10 != 0:
    ans += 10 - (a[i] % 10)

ans += a[last]

print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
S = list(input())[: -1]
n = S.count("N") > 0
e = S.count("E") > 0
s = S.count("S") > 0
w = S.count("W") > 0
if n and s or (n == 0 and (s == 0)):
  if e and w or (e == 0 and (w == 0)):
    print("Yes")
    exit(0)
print("No")
# Judge status: Accepted
W,a,b =map(int,input().split())
if b>=a:
    if b-(a+W)<0:print(0)
    else:print(b-(a+W))
else :
    if a-(b+W)<0:print(0)
    else:print(a-(b+W))
# Judge status: Accepted
n = int(input())
num = 0
for k in range(1,n+1):
    #print(k)
    if k*(k+1) >=2*n:
        break
if k*(k+1) == 2*n:
    for i in range(k):
        print(i+1)
else:
    num = k*(k+1)//2-n
    #print(num,k*(k+1)//2)
    for i in range(k):
        if i+1 == num:
            continue
        else:
            print(i+1)
# Judge status: Accepted
s=input()
ans = 'No'
if s[2] == s[3]:
    if s[4] == s[5]:
        ans = 'Yes'

print(ans)
# Judge status: Accepted
s=input()
if len(s)%2==1:

    n1=(len(s)-1)//2
    n2=(len(s)+2)//2
    s1=s[0:n1]
    s2=s[n2:len(s)]
    if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
x, y, z = map(int, input().split())

ans = 0
while x >= y + z:
    ans += 1
    x -= y + z

print(ans)
# Judge status: Accepted
C = input()
ABC = [chr(i) for i in range(97, 97+26)]
index = ABC.index(C)
next = index + 1
print(ABC[next])
# Judge status: Accepted
n,k = map(int,input().split())
import math

def succ(m): #サイコロの目がmの時、kを超えるようにコインの表を出し続ける最小の回数
  res = 0
  while True:
    if m < k:
      res += 1
      m *= 2
    if m >= k:
      return res

def pos():
  res = 0
  for i in range (1, n+1):
    m = n*2**succ(i)
    res += 1/m
  return res

print(pos())
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0

if a == b == c and a%2 == 0:
    print(-1)
    exit()

while acnt%2 != 1 and bcnt%2 != 1 and ccnt%2 != 1:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt

print(cnt)
# Judge status: Accepted
N,X = map(int, input().split())
x = [int(i) for i in input().split()]

x.append(X)
x.sort()

from fractions import gcd

ans = 0
for i in range(N):
    ans = gcd(ans, x[i+1] - x[i])

print(ans)
# Judge status: Wrong Answer
import collections

n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]
ans_count = []
count = collections.Counter(a)
for i in range(q):
  num = count[bc[i][0]]
  count[bc[i][0]] = 0
  count[bc[i][1]] += num
  ans_count.append(count)

for ans in ans_count:
  total = 0
  for key, value in zip(count.keys(), count.values()):
    total += int(key) * int(value)
  print(total)
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))

dp = [0] * n

for i in range(1,n):
    if i == 1:
        dp[i] = abs(h[1] - h[0])
    else:
        dp[i] = min(abs(h[i] - h[i-1]) + dp[i-1], abs(h[i] - h[i-2]) + dp[i-2])

print(dp[-1])
# Judge status: Accepted
n=int(input())
P=list(map(int,input().split()))
Q=list([i+1 for i in range(n)])
cnt=0
for i in range(n):
    if P[i]!=Q[i]:
        cnt+=1
print('YES' if cnt<=2 else 'NO')
# Judge status: Wrong Answer
n, q = map(int, input().split())
s = input()

L = [0]*len(s)
for i in range(1,len(s)):
    L[i] = L[i-1]
    if s[i-1] == "A" and s[i] == "C":
        L[i] += 1

print(L)

for _ in range(q):
    l, r = map(int, input().split())
    print(L[r-1]-L[l-1])
# Judge status: Wrong Answer
N=input()
list=[int(x) for x in input().split()]
i=0
kei=0
k=0
while(i!=len(list)-1):
    if(list[i]>list[i+1]):
        kei+=list[i]-list[i+1]
        list[i+1]=list[i]
        print(kei)
    i+=1
print(kei)
# Judge status: Accepted
X, Y = map(int, input().split())
Z = X
c = 0
while Z <= Y:
    c += 1
    Z = 2 * Z
print(c)
# Judge status: Accepted
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    x = input_number_list()
    print(x.index(0)+1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
P = [int(i) for i in input().split()]

Q = sorted(P)
ans = 0
for p, q in zip(P, Q):
    if p != q:
        ans += 1

if ans == 0 or ans == 2:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
def resolve():
	n = int(input())
	ans = 0
	a = list(map(int, input().split()))
	y = sum(a) / n
	for x in a:
		if x == y:
			continue
		ans += (x-y)**2
	print(round(ans))

resolve()
# Judge status: Accepted
# input 長さ3の文字列
input_s = input();

output = 0;

if "R" in input_s:
    output = 1;

if "RR" in input_s:
    output = 2;

if "RRR" in input_s:
    output = 3;

print(output);
# Judge status: Accepted
from collections import Counter

N = int(input())
A = list(map(int, input().split()))
i_plus_A = Counter([i + A[i] for i in range(N)])
i_minus_A = [i - A[i] for i in range(N)]
i_minus_A = [x for x in i_minus_A if x > 0]
print(sum(i_plus_A[x] for x in i_minus_A))
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Fri May 15 00:52:33 2020

@author: Kanaru Sato
"""

import fractions

def divnum(x,y,n):
    if x%n == 0:
        return y//n - x//n + 1
    else:
        return y//n - x//n

a,b,c,d = list(map(int,input().split()))
cd = (c*d)//fractions.gcd(c,d)
ans = divnum(a,b,c) + divnum(a,b,d) - divnum(a,b,cd)
print(b-a+1-ans)
# Judge status: Wrong Answer
k, a, b = map(int, input().split())
if k > a+2 and b > a:
    x = 1 + k
    t = (k-a+1)//2
    y = t * (b-a) + (k-t*2) + 1
    print(max(x,y))
    exit()
else:
    z = 1 + k
    print(z)
# Judge status: Accepted
n=int(input())
A = [-1]*(n+2)
A[0]=2
A[1]=1
for i in range(2,n+1):
    A[i] = A[i-1] + A[i-2]
print(A[n])
# Judge status: Accepted
import sys
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))

if N <= 2:
    print(1)
    sys.exit()

A = [A[0]] + [y for x,y in zip(A,A[1:]) if x != y]
sq = np.diff(A)

ans = 1
flg = 0
prev = sq[0]
for i in range(1, len(sq)):
    if flg==1:
        prev = sq[i]
        flg = 0
        continue
    current = sq[i]
    if (prev * current) > 0:
        continue
    else:
        ans += 1
        prev = current
        flg = 1

print(ans)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
n = int(input())
if n%2 == 0:
    print(int(n/2))
else:
    print(int(n//2))
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

l,r = inpl()
r = min(r,l+3000)
res = INF
for i in range(l,r):
    for j in range(i+1,r+1):
        res = min(res, (i*j)%2019)
print(res)
# Judge status: Accepted
print(int((int(input())+int(input()))/2*int(input())))
# Judge status: Wrong Answer
sub = int(input())
print((1+sub) * sub / 2)
# Judge status: Accepted
L, R, d = map(int, input().split())

ans = 0
for i in range(L, R+1):
    if i % d == 0:
        ans += 1
print(ans)
# Judge status: Wrong Answer
#4
N,W=map(int,input().split())
A=[[0]]+[[int(x) for x in input().split()] for i in range(N)]

dp=[[0 for i in range(W+1)] for j in range(N+1)]

for i in range(1,N+1):
    for sum_w in range(W+1):
        w=A[i][0]
        v=A[i][1]
        if sum_w-w>=0:
            dp[i][sum_w]=max(dp[i][sum_w],dp[i-1][sum_w-w]+v)
        else:
            dp[i][sum_w]=dp[i-1][sum_w]
        
print(dp[N][W])
# Judge status: Accepted
import math
A,B,C,D = map(int,input().split())
BIkaCbaisuC = B//C
AIkaCbaisuC = (A-1)//C
ABkanCbaisuC = BIkaCbaisuC - AIkaCbaisuC

BIkaDbaisuC = B//D
AIkaDbaisuC = (A-1)//D
ABkanDbaisuC = BIkaDbaisuC - AIkaDbaisuC

cd = math.floor(C*D/math.gcd(C,D))
BIkacdbaisuC = B//cd
AIkacdbaisuC = (A-1)//cd
ABkancdbaisuC = BIkacdbaisuC - AIkacdbaisuC

print(B-A+1-ABkanCbaisuC-ABkanDbaisuC+ABkancdbaisuC)
# Judge status: Accepted

N, D = map(int, input().split())
X = [0] * N
Y = [0] * N
num = 0
for i in range(N):
    X[i], Y[i] = map(int, input().split())
    
    if (X[i]**2+Y[i]**2)**0.5 <= D:
        num += 1

print(num)
# Judge status: Wrong Answer
n=int(raw_input())
a=[]
for i in range(0,n,1):
    x=int(raw_input())
    for j in range(0,len(a),1):
        if x == a[j]:
            a.pop(j)
            break
        a.append(x)
    if len(a) == 0:
        a.append(x)
print len(a)
# Judge status: Accepted
import heapq
N, M = map(int, input().split())
A = list(map(lambda x: int(x) * -1, input().split()))
heapq.heapify(A)

for _ in range(M):
    discount = (-1) * heapq.heappop(A)
    discount //= 2
    heapq.heappush(A, -discount)

print(-sum(A))
# Judge status: Accepted
x, y = map(int, input().split())
ans = "No"
for i in range(x + 1):
    if i * 2 + (x - i) * 4 == y:
        ans = "Yes"
        break
print(ans)
# Judge status: Accepted
import heapq

N,M = map(int,(input().split()))
A = [0]*N
B = [0]*N
mission = [[] for _ in range(M+1)]
work = 0

for i in range(N):
    if i <= M:
        heapq.heapify(mission[i])
    A[i],B[i] = map(int,(input().split()))
    if A[i] <= M:
        mission[A[i]].append(-B[i])

for day in range(1,M+1):
    for i in range(len(mission[day])):
        heapq.heappush(mission[0],mission[day][i])
    if mission[0]:
        work += heapq.heappop(mission[0])

print(-work)
# Judge status: Accepted
from math import *
N,M = map(int,input().split())

if abs(N-M)==0:
  ans = 2*factorial(N)*factorial(M)
elif abs(N-M)==1:
  ans = factorial(N)*factorial(M)
else:
  ans = 0

print(ans%(10**9+7))
# Judge status: Accepted
li,lia = [],[]
total = 0
for i in range(5):
    a = input()
    li.append(a)
for i in range(5):
    lia.append(li[i][-1])
lib = [int(s) for s in lia]
b = lib.count(0)
for i in range(b):
    lib.remove(0)
for i in range(5):
    total += (int(li[i])//10+1)*10
if len(lib) >= 1:
    total -= 10*(1+b)
else:
    total -= 10*(b)
if len(lib) >= 1:
    total += min(lib)
if total <= 0:
    print(0)
else:
    print(total)
# Judge status: Accepted
L=list(map(int,input().split()))
A=abs(L[0]-L[1])
B=abs(L[0]-L[2])
if min(A,B)==A:
	print("A")
else:
	print("B")
# Judge status: Accepted
K,N=map(int,input().split())
A=list(map(int,input().split()))
a=[]
for i in range(len(A)-1):
  a.append(A[i+1]-A[i])
a.append(K-A[-1]+A[0])
print(sum(a)-max(a))
# Judge status: Accepted
N, A, B = map(int, input().split())
print(max(0, B*(N-2) - A*(N-2)  +1))
# Judge status: Accepted
from collections import Counter

n = int(input())
s_inputs = [input() for i in range(n)]
m = int(input())
t_inputs = [input() for i in range(m)]

s_count = Counter(s_inputs)
t_count = Counter(t_inputs)

ans=0
for s in set(s_inputs+t_inputs):
    tmp = s_count[s]-t_count[s]
    if tmp>ans:
        ans=tmp
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
C = []
D = 0
ans = []

for a in A:
  if a<3200:
    C+=[a//400]
  else:
    D+=1

if D==0:
  ans = [len(set(C)),len(set(C))]
else:
  if len(C)==0:
    ans = [1,D]
  else:
    ans = [len(set(C)),len(set(C))+D]

print(*ans)
# Judge status: Accepted
# author:  Taichicchi
# created: 10.09.2020 08:12:15

import sys

A, B, K = map(int, input().split())

cnt = 0

ls = []

for k in range(1, max(A, B) + 1):
    if (A % k == 0) & (B % k == 0):
        cnt += 1
        ls.append(k)

print(ls[-K])
# Judge status: Accepted
def main():
    n = int(input())
    print((n*(n+1))//2 - n)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import statistics

n = int(input())
A = list(map(int, input().split()))
A_1 = [A[i] - (i+1) for i in range(n)]
m = int(statistics.median(A_1))
A_2 = [abs(m - A_1[i]) for i in range(n)]
print(sum(A_2))
# Judge status: Accepted
A, B, C, K = map(int,input().split())
ans = A - B
if abs(ans) > 10 ** 18:
    print('Unfair')
elif K % 2 == 1:
    ans *= -1
    print(ans)
else:
    print(ans)
# Judge status: Accepted
from sys import stdin

s = stdin.readline().rstrip()

len_s = len(s)

for i in range(int(len_s/2+1)):
    if i != 0:
        if s[0:int(-i+len_s/2)] == s[int(-i+len_s/2):(len_s-i*2)]:
            print(len_s-i*2)
            break
# Judge status: Accepted
A,B,D=map(int,input().split())
count=0
D+=0.5
while True:
    if D-A>=0:
        count+=1
        D-=A
    else:
        print(count*B)
        exit()
# Judge status: Accepted
import sys
X = int(input())
def is_prime(X):
    for i in range(2,X):
        if X % i == 0:
            return False
    return True
if is_prime(X):
    print(X)
    sys.exit(0)
else:
    while True:
        if X%2 == 0:
            X+=1
        else:
            if is_prime(X):
                print(X)
                sys.exit(0)
            X+=2
# Judge status: Wrong Answer
A,B=map(int,input().split())
S=input()
if str.isdigit(S[:A])==True and str.isdigit(S[-4:])==True and S[A]=="-":
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
A1=set(A)
ans="NO"
if len(A)==len(A1):
    ans="YES"
print(ans)
# Judge status: Accepted
n=int(input())
S=[input() for i in range(n)]
print(len(set(S)))
# Judge status: Wrong Answer
a,b,c=list(map(str,input().split()))
c=b[0]
print('A '+c+' C')
# Judge status: Accepted
A,B = map(int,input().split())

if A > 8 or B > 8 :
    print(":(")
else:
    print("Yay!")
# Judge status: Wrong Answer
import fractions
A, B, C, D = map(int, input().split())


def func(x,y):
    if(x<0):
        assert()
    if(y<=0):
        assert()
    # print(x,y,int(x/y))
    # return int((x/y))
    # print(x,y,x//y)
    return (x//y)

# print(func(100,10))


lcm = (C * D) / int(fractions.gcd(C, D))
print(int( B - func(B, C) - func(B, D) + func(B, lcm) - A + 1 + func(A-1, C) + func(A-1, D) - func(A-1, lcm)))
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))
count = 0
MIN = p[0]
for i in range(n):
    if p[i] <= MIN:
        count += 1
        MIN = p[i]
        if MIN == 1:
            break
print(count)
# Judge status: Accepted
a, b, _, k = map(int, input().split())
print((a - b)*((-1)**(k % 2)))
# Judge status: Accepted
n=int(input())
k=max([0,n-int(input())])
x=int(input())
y=int(input())
print(x*(n-k)+y*k)
# Judge status: Accepted
s=input()
a=int(s[:2])
b=int(s[2:])
if (a > 12 or a == 0) and (b > 12 or b == 0):
	print("NA")
elif a > 12 or a == 0:
	print("YYMM")
elif b > 12 or b == 0:
	print("MMYY")
else: print("AMBIGUOUS")
# Judge status: Accepted
# 適当に10**5ぐらい回して無限に続けられたら-1でよくね？
A, B, C = map(int, input().split())


def update(A, B, C):
    return B // 2 + C // 2, C // 2 + A // 2, A // 2 + B // 2


for i in range(10 ** 5):
    if A & 1 or B & 1 or C & 1:
        print(i)
        exit()
    A, B, C = update(A, B, C)

print(-1)
# Judge status: Accepted
n=int(input())
ab = []
for _ in range(n):
    a= int(input())
    ab.append(a)

ab.sort()
memo = 1
ans = 0
for i in range(n):
    if i == n-1:
        ans += memo%2
    elif ab[i] == ab[i+1]:
        memo += 1
    else:
        ans += memo%2
        memo = 1
print(ans)
# Judge status: Accepted
n = int(input())
inp = list(map(int,input().split()))
d = {}
for x in inp:
    d[x] = d.get(x, 0) + 1
v = [0 for _ in range(n+1)]
for x, y in d.items():
    v[x] = (y)*(y-1)//2
tot = sum(v)
for i in range(n):
    print(tot-v[inp[i]]+((d[inp[i]]-1)*(d[inp[i]]-2)//2))
# Judge status: Wrong Answer
a, b, c = map(str, input().split())
if a <= c and c <= b:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
from math import floor
a, b, n = map(int, input().split())
ans = 0
for i in range(min(5, n)):
    score = floor(a*(n-i)/b) - a*floor((n-i)/b)
    ans = max(score, ans)
print(ans)
# Judge status: Accepted
import sys
#input = sys.stdin.readline
input = sys.stdin.buffer.readline

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np


def main():
	n=int(input())
	s="abcdefghijklmn"

	li=[[] for _ in range(10)]
	li[0]=[["a",0]]


	for i in range(1,10):

		for t,val in li[i-1]:
			for j in range(val+2):
				li[i].append([t+s[j],max(val,j)])

	for t,_ in li[n-1]:
		print(t)


if __name__ == "__main__":
	main()
# Judge status: Accepted
x = int(input())

ans = 1
ls=[x for x in range(400,2000,200)]

for i in range(len(ls)-1):
    if ls[i] <= x < ls[i+1]:
        ans = 8-i
        break

print(ans)
# Judge status: Wrong Answer
def main():
    x = int(input())

    for i in range(x + 1):
        if 0 <= x - 100 * i < 5 * i:
            print(1)
            exit()
    else:
        print(0)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a <= 5:
    print(0)
elif a <= 12:
    print(b/2)
else:
    print(b)
# Judge status: Accepted
n, x = (int(i) for i in input().split())
list_l = [int(j) for j in input().split()]
tmp = 0
count = 0
for i in range(0, n + 1):
    if i == 0:
        pass
    else:
        tmp += list_l[i - 1]
        if tmp > x:
            break
    count += 1
print(count)
# Judge status: Accepted
str_menu,int_menu,fir_digi,ans=[str(input()) for i in range(5)],[],[],0
for i in range (5):
    fir_digi.append(int(str_menu[i][-1]))
    int_menu.append(int(str_menu[i]))
while min(fir_digi)==0:
    fir_digi[fir_digi.index(0)]=10

for i in range (5):
    if i!=fir_digi.index(min(fir_digi)):
        if fir_digi[i]!=10:
            int_menu[i]=int(int_menu[i]/10)*10+10
    ans=ans+int_menu[i]
print(ans)
# Judge status: Accepted
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))

s = 0
d = defaultdict(int)
for e in A:
    d[e] += 1
k = len(set(d))

for v in d.values():
    s += v*(v-1)//2

for e in A:
    if d[e] > 1:
        res = s - (d[e]-1)
        print(res)
    else:
        print(s)
# Judge status: Accepted
n = int(input())
s = [input() for _ in range(n)]

import collections
c0 = collections.Counter(s)
c1 = c0.most_common()
max = c1[0][1]
l = []
for x, i in c0.items():
    if i == max:
        l.append(x)
ans = sorted(l)
for i in ans:
    print(i)