peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import numpy as np

n = int(input())
a = list(map(int, input().split()))
b = np.array(a)

if a.count(0) > 0:
  print(0)
  exit()
  
temp = b.prod()

if temp > 10**18:
  print('-1')
  exit()

print(temp)
# Judge status: Accepted
N = int(input())
cnt = 0
for i in range(1,N+1):
    if len(bin(i))-bin(i).rfind("1") >= cnt:
        cnt += 1
        ans = i
print(ans)
# Judge status: Wrong Answer
s = input()
k = int(input())
n = len(s)
for i in range(n):
  num = ord(s[i])
  if 123-num > k:
    continue
  k -= (123-num)
  s = s[:i] + 'a' + s[i+1:]
if k > 0:
  t = k%26
  s = s[:n-1] + chr(ord(s[n-1])+t)
print(s)
# Judge status: Wrong Answer
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
    if h[i]>h[i+1]:
        h[i]-=1
        if h[i]>h[i+1]:
            print("No")
            quit()
print("Yes")
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = Counter(a)
ma = a[-1]

check = [True] * (ma+1)

ans = 0
for i in range(n):
    if check[a[i]]:
        if b[a[i]] == 1:
            ans += 1
            
        for j in range(a[i],ma+1,a[i]):
            check[j] = False
            
print(ans)
# Judge status: Wrong Answer
# import sys
# input = sys.stdin.readline
import collections
import itertools

def main():
    n, k = input_list()
    a = input_list()
    if (n - 1) % (k - 1) == 0:
        print(n-1 // k-1)
    else:
        v = (n-1) // (k-1)
        print(v + (n - 1) % (k - 1))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()
# Judge status: Accepted
lis = list(map(int, input().split()))
lis.sort()

if lis[0] == 5 and lis[1]==5 and lis[2]== 7:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
X=input()
ans=0
scnt=0
for i in range(len(X)):
  ans+=1
  if X[i]=='S':
    scnt+=1
  if scnt>0 and X[i]=='T':
    scnt-=1
    ans-=2
print(ans)
# Judge status: Accepted
def main():
    n, k = list(map(int, input().split()))
    S = list(input())
    count = 0
    h = 0
    for i in range(n - 1):
        if S[i] != S[i + 1]:
            count += 1
    b = max(0, count + 1 - 2 * k)
    print(min(n - 1, n - b))

if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
a=int(input())
n=int(math.sqrt(a))
print(n**2)
# Judge status: Wrong Answer
import numpy as np

N = int(input())
W = input().split()

for i in range(N):
    W[i] = int(W[i])
min_w= 100000
for i in range(N-1):
    w1 = W[:i]
    w2 = W[i+1:N-1]
    w1 = np.array(w1)
    w2 = np.array(w2)
    min_w = min(min_w, abs(np.sum(w2)-np.sum(w1)))

print(min_w)
# Judge status: Wrong Answer
N,K = map(int,input().split())
x = [int(i) for i in input().split()]
ans = 10**5
for i in range(N-K+1):
  left =x[i]
  right =x[i+K-1]
  p1 = abs(left) + abs(right-left)
  p2 = abs(right) + abs(right-left)
  p = min(p1,p2)
  ans = min(ans,p)
  
  
print(ans)
# Judge status: Accepted
arg=input().split()
N=int(arg[0])
M=int(arg[1])
if N==M:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
x = list(map(int, input().split()))
x.sort()
a, b, c = x
ans = 0
if (c - a) % 2 == (c - b) % 2:
    print((2 * c - a - b)//2)
else:
    print((2 * c + 1 - a - b)//2 + 1)
# Judge status: Wrong Answer
N,P=map(int,input().split())
*A,=map(int,input().split())

if N==1:
    if P==0:
        print(1+1*(A[0]%2==0))
    else:
        print(1*(A[0]%2==1))
else:
    print(2**(N-1))
# Judge status: Wrong Answer
n=int(input())
l=[0]*5
for i in range(5):
  l[i]=int(input())
l.sort()
if l[0]>=n:
  print(5)
else:
  print(n//l[0]+5)
# Judge status: Wrong Answer
a,b,c = map( int, input().split())
if a == b == c :
    print(1)
elif a!=b==c or a==b!=c or c!=a==b :
    print(2)
else:
    print(3)
# Judge status: Accepted

s = input()

for i in range(len(s)):
    if s[i] == "U" or s[i] == "D":
        continue
    elif (i+1) % 2 == 0:
        if s[i] != "L":
            print("No")
            exit()
    else:
        if s[i] != "R":
            print("No")
            exit()
print("Yes")
# Judge status: Wrong Answer
N = int(input())
ans = list()

for i in range(N):
    ans.append(0)

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if tmp < N:
                ans[tmp] += 1
for i in range(N):
    print(ans[i])
# Judge status: Wrong Answer
import numpy as np

c = [list(map(int, input().split())) for i in range(3)]
c = np.array(c)
flag = False
for a1 in range(min(c[0] + 1)):
    b1 = c[0, 0] - a1
    b2 = c[0, 1] - a1
    b3 = c[0, 2] - a1
    if c[1, 0] - b1 == c[1, 1] - b2 == c[1, 2] - b3 and c[2, 0] - b1 == c[2, 1] - b2 == c[2, 2] - b3:
        print('Yes')
        flag = True

if not flag:
    print('No')
# Judge status: Wrong Answer
from collections import deque
S = deque([i for i in input()])
Q = int(input())
#list = [['1', "0", "0"] for i in range(Q) ]
for i in range(Q):
    a = input()
    if a[0] == '2':
        p, q, r = map(str, a.split())
        if q == "1":
            S.appendleft(r)
        else:
            S.append(r)
    else:
        tmp = S[0]
        S[0] = S[-1]
        S[-1] = tmp
ans = ""
N = len(S)
for i in range(N):
    ans = ans + S.popleft()
print(ans)
# Judge status: Wrong Answer
num_str = input()

if '9' in num_str:
    print('yes')
else:
    print('No')
# Judge status: Wrong Answer
N,M = map(int,input().split())
print(N*(N-1)/2+M*(M-1)/2)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
if abs(a-c)<=d:
    print("Yes")
elif abs(a-b)<=d and abs(b-c)<=d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
b = [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])
ans = 0
j = M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] + a[i] > K:
        j -= 1
    ans = max(ans, i + j)
print(ans)
# Judge status: Wrong Answer
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

if __name__ == "__main__":
    X, Y, A, B, C = MI()
    p = LI()
    p.reverse()
    q = LI()
    q.reverse()
    pq = p[:X] + q[:Y] + LI()
    print(sum(pq[:X+Y]))
# Judge status: Accepted
N, D = map(int, input().split())
ans = 0
for i in range(N):
  X, Y = map(int, input().split())
  if X*X+Y*Y<=D*D:
    ans += 1
print(ans)
# Judge status: Accepted
import sys
def main():
    input = sys.stdin.readline
    N=int(input())
    *A,=map(int, input().split())
    *B,=map(int, input().split())

    asum=sum(A)
    bsum=sum(B)
    asmall=0
    bsmall=0
    for a,b in zip(A,B):
        asmall+=(max(0, b-a)+1)//2
        bsmall+=max(0, a-b)
    t=bsum-asum
    print('Yes' if t>=max(asmall,bsmall) else 'No')

if __name__ == '__main__':
    main()
# Judge status: Accepted
k, a, b = map(int, input().split())

if a >= b:
    print(k + 1)
else:
    d = b-a
    if k < a or d // 2 <= 1:
        print(k + 1)
    else:
        t = k - (a - 1)
        print(a + t//2 * d + t % 2)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())

if a!=b and a!=c:
    print(3)
elif a==b and a!=c:
    print(2)
elif a==c and a!=b:
    print(2)
elif b==c and b!=a:
    print(2)
else:
    print(1)
# Judge status: Wrong Answer
q, h, s, d = map(int, input().split())

q *= 4
h *= 2
d //= 2

n = int(input())

if n % 2 == 0:
    print(n * min(q, h, s, d))
else:
    tmp = min(q, h, s)
    if d < tmp:
        print((n - 1) * d + min(q, h, s))
    else:
        print(n * tmp)
# Judge status: Accepted
def main():
    K, S = map(int, input().split())
    ans = 0
    for x in range(K + 1):
        for y in range(K + 1):
            z = S - x - y
            if z >= 0 and z <= K:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import math
a, b, x = map(int, input().split())
ans = a*(b**2)/2/x
print(math.degrees(math.atan(ans)))
# Judge status: Accepted
a = list(map(int, input().split()))
# ab_sorted = sorted(ab, key=lambda x: x[0])
#ab = [list(map(int, input().split())) for i in range(n)]
# print(min(15*n, 100*(n//10+1), 100*(n//10)+15*(n % 10)))

for i in range(5):
    if a[i] == 0:
        print(i+1)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
MOD = 10**9+7

n, m = map(int, readline().split())
a = set(map(int, read().split()))

dp = [0] * (n + 1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
cnt = 0
for i in range(2, n + 1):
    if i not in a:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
        cnt = 0
    else:
        cnt += 1
        if cnt == 2:
            print('0')
            exit()
print(dp[n])
# Judge status: Accepted
import collections

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

c = collections.Counter(a)
i = 0
cnt = 0
for key, val in sorted(c.items(), key=lambda x: -x[1]):
    # print(key, val)
    cnt += val
    i += 1
    if i >= k:
        break
        
print(n - cnt)
# Judge status: Wrong Answer
a,b = int(),input().split()
print(a*b)
# Judge status: Accepted
#!/usr/bin/env python3
A,B,C = [int(s) for s in input().split()]

print(0) if B+C <= A else print(C-(A-B))
# Judge status: Accepted
x,a,b=map(int,input().split())

if a-b >=0:
    print("delicious")
else:
    if a+x >= b:
        print("safe")
    else:
        print("dangerous")
# Judge status: Accepted
N, X, Y = map(int, input().split())
ans = [0] * N

for i in range(N):
  for j in range(i+1, N):
    tmp = min(j-i, abs(X-1-i) + 1 + abs(Y-1-j))
    ans[tmp] += 1

for k in range(1,N):
  print(ans[k])
# Judge status: Wrong Answer
a,b,k=map(int,input().split())
if k<=a:
    print(a-k, b)
elif a<k<b:
    print("0", b-(k-a))
else:
    print("0", "0")
# Judge status: Wrong Answer
s,w=map(int,input().split())
if s < w:
  print("unsafe")
else:
  print("safe")
# Judge status: Accepted
X=int(input())
if(1800<=X):
    print(1)
elif(1600<=X):
    print(2)
elif(1400<=X):
    print(3)
elif(1200<=X):
    print(4)
elif(1000<=X):
    print(5)
elif(800<=X):
    print(6)
elif(600<=X):
    print(7)
elif(400<=X):
    print(8)
# Judge status: Wrong Answer
s = input()
k = "keyence"
j = 0

for i in range(len(s)):
    if s[i]==k[j]:
        j+=1
    if j==7:
        print("YES")
        exit()
print("NO")
# Judge status: Accepted
N = int(input())
h = list(map(int, input().split()))

opt = [0] * len(h)
opt[1] = abs(h[0]-h[1])

for i in range(2,len(h)):
    A = opt[i-1] + abs(h[i-1] - h[i])
    B = opt[i-2] + abs(h[i-2] - h[i])
    opt[i] = min(A, B)
print(opt[-1])
# Judge status: Accepted
print((sum(list(map(int, input().split()))) + 1) // 2)
# Judge status: Wrong Answer
X = int(input())

i = 0
while X > 0:
  i += 1
  if X-i >= i + 1:
    X -= i
  else:
    break

if 2*X <= 3*i + 3:
  print(X)
else:
  print(3*i + 3 - X)
# Judge status: Accepted
n = int(input())
x = 800*n
y  = (n//15)*200
print(x-y)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

mod = 10 ** 9 + 7
digits = [0] * 60
ans = 0
for ai in a:
    temp = ai
    num = len(bin(temp)) - 2
    for i in range(num):
        if (temp >> i) & 1:
            digits[i] += 1
    ans += (n - 1) * temp
    ans = ans % mod

for i in range(60):
    digit = digits[i]
    temp = digit * (digit - 1) * pow(2, i, mod)
    ans -= temp % mod
print(ans % mod)
#print(digits)
# Judge status: Accepted
N, L = map(int, input().split())
a=[]

for i in range(N):
    A = input()
    a.append(A)

a.sort()
print("".join(a))
# Judge status: Accepted
n = int(input())
L0 = 2
L1 = 1
if n == 1:
    print(1)
else:
    for i in range(1,n):
        L2 = L0 + L1
        L0 = L1
        L1 = L2
    print(L2)
# Judge status: Accepted
n, k = map(int, input().split())
x = list(map(int, input().split()))

minus = [0]
plus = [0]
if 0 in x:
    k -= 1

for i in x:
    if i < 0:
        minus.append(abs(i))
    elif i > 0:
        plus.append(i)
minus.sort()
#print(minus)
#print(plus)
ans = float("inf")
for left in range(len(minus)):
    if 0 <= k-left < len(plus):
        right = k-left
        res = 2*minus[left] + plus[right]
        res = min(res, minus[left] + 2*plus[right])
        ans = min(ans, res)

print(ans)
# Judge status: Accepted
def ketawa(x):
    l = list(str(x))
    wa = 0
    for a in l:
        wa += int(a)
    return wa

n = int(input())
lst = list(str(n))
keta = len(str(n))




nine = int("".join([lst[0]] + ["9"]*(keta-1)))

if nine <= n:
    print(ketawa(nine))
else:
    lst_head = str(int(lst[0]) - 1)
    nine = int("".join([lst_head] + ["9"]*(keta-1)))
    print(ketawa(nine))
# Judge status: Wrong Answer
s = input()
ans = 0
if s[0]  == "R":
    ans += 1
    if s[1] == "R":
        ans += 1
        if s[2] == "R":
            ans += 1

print(ans)
# Judge status: Accepted
def solve(a,b,k):
  if k <= a: return a - k, b
  elif k <= a + b: return 0, b - (k - a)
  else: return 0, 0

a,b,k = map(int,input().split())
ans_1, ans_2 = solve(a,b,k)
print(f"{ans_1} {ans_2}")
# Judge status: Accepted
#145
n = int(input())
s = input()

if n % 2 != 0:
    print("No") 
else:
    if s[0:n//2] == s[n//2:]:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
from bisect import bisect_left
n = int(input())
A = list(map(int,input().split()))
A.sort()
y = max(A)
idx = bisect_left(A, y//2)
print(y,A[idx])
# Judge status: Wrong Answer
N,D = map(int,input().split(" "))
 
for _ in range(N):
  count=0
  p,q=map(int,input().split(" "))
  if (p**2 + q**2)**0.5 <=D:
    count+=1
print(count)
# Judge status: Accepted
from collections import deque
import sys

n = int(input())

ab = []
for _ in range(n):
	ab.append(list(map(int,input().split())))

ab = sorted(ab, key=lambda x:x[1], reverse=True)

d = []
d = deque(d)
num = 0
while len(ab) > 0:
	d = deque([])
	d.append(ab.pop())
	while True:
		if len(ab) == 0:
			break
		if ab[-1][1] == d[0][1]:
			d.append(ab.pop())
		else:
			break
	for i in range(len(d)):
		a,b = d.pop()
		num += a
	if num > b:
		print('No')
		sys.exit()

print('Yes')
# Judge status: Accepted
a = input()
if a in 'ABCDEFGFIJKLMNOPQRSTUVWXYZ':
    print('A')
else:
    print('a')
# Judge status: Accepted
def solve():
  x, y = map(int, input().split())
  ans = float('inf')
  if y>=x:
    ans = min(ans,y-x)
  if y>=-x:
    ans = min(ans,y+x+1)
  if -y>=x:
    ans = min(ans,-y-x+1)
  if -y>=-x:
    ans = min(ans,-y+x+2)
  return ans
print(solve())
# Judge status: Accepted
import math

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

r = 0
l = 1e9

test_count = 0

while (l - r > 1) :
    target_log_len = (r + l) // 2
    cut_count = 0

    for log_len in A:
        cut_count += (log_len - 1) // target_log_len

    if cut_count <= K:
        l = target_log_len
    else:
        r = target_log_len

    test_count += 1
    if test_count > 100:
        break

print(int(l))
# Judge status: Accepted
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
    s = sum(map(int, str(i)))
    if A <= s <= B:
        ans += i
print(ans)
# Judge status: Accepted
N =int(input())
A = list(map(int,input().rstrip().split(" ")))
Aq = []
DP = [0 for i in range(5 * 10 ** 5)]
DPP = []
ans = 0
for i in range(N):
    if i >= A[i]:
        ans += DP[i - A[i]]
    if A[i] <= N:
        DP[A[i] + i] += 1
    
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())

if A < 10 and B < 10:
  print(A*B)
else:
  print(-1)
# Judge status: Accepted
X,A,B = map(int,input().split())
if A-B >= 0:
	  print("delicious")
elif X+A-B >= 0:
	  print("safe")
else:
    print("dangerous")
# Judge status: Accepted
n, a, b = map(int,input().split())
add = 0
if ( n % (a + b) ) < a :
    add = ( n % (a + b) ) % a
else:
    add = a
print((n // (a + b)) * a + add)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
if a == b and b == c:
    count=0
    print(count)
    exit(0)
    
ls = [a,b,c]
ls.sort(reverse=True)
count = 0
print(ls)
print(ls[0])

if (ls[1]-ls[2])%2 != 0:
    ls[2] = ls[2]+1
    ls[0] = ls[0]+1
    count +=1

while ls[1] - ls[2] >= 2:
    ls[2] += 2
    count += 1

if ls[1] - ls[2] == 1:
    ls[2] += 1
    count +=1

dif = ls[0] - ls[1]
count = count + dif

print(count)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

g = gcd(a[0], a[1])
for i in range(2, n):
    g = gcd(g, a[i])
print(g)
# Judge status: Wrong Answer
A = [int(i) for i in input().split()]
print(A[0] + A[1])
# Judge status: Accepted
n = int(input())
s = list(input())

#E(東)を向いてる人数
ruiseki = [0]
for i in range(n):
    if s[i] == "E":
        ruiseki.append(ruiseki[i] + 1)
    else:
        ruiseki.append(ruiseki[i])

INF = float("inf")
ans = INF
for i in range(n):
    if s[i] == "E":
        sub = -1
    else:
        sub = 0
    change = i - (ruiseki[i] - ruiseki[0] - sub)
    change += ruiseki[-1] - ruiseki[i]
    ans = min(ans, change)

print(ans)
# Judge status: Accepted
nums = [i for i in input().split()]
nums = list(set(nums))
print('Yes' if len(nums) == 2 else 'No')
# Judge status: Accepted
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
c = dict(c)
c = sorted(c.items(), key=lambda x:x[0], reverse=True)
h = 0
w = 0
for i in range(len(c)):
  if c[i][1] >= 2 and h == 0:
    h = c[i][0]
    if c[i][1] >= 4:
      w = c[i][0]
  elif c[i][1] >= 2 and w == 0:
    w = c[i][0]
ans = h * w
print(ans)
# Judge status: Accepted
n=int(input())
a=list(int(input())for _ in range(n))
p=a[0]
count=1
for i in range(n):
    if p==2:
        print(1)
        exit()
    else:
        ans=a[p-1]
        p=ans
        count+=1
        if ans==2:
            print(count)
            exit()
print('-1')
# Judge status: Accepted
I=lambda:list(map(int,input().split()))
n,m=I()
a=I()
a.sort(reverse=True)
qq=[I() for i in range(m)]
qq.sort(key=lambda x:x[1],reverse=True)
ans=0
for x,y in qq:
    for j in range(x):
        if not a:
            break
        aa=a.pop()
        ans+=max(aa,y)
ans+=sum(a)
print(ans)
# Judge status: Accepted
k, s = map(int, input().split())

count=0
for i in range(k+1):
  for j in range(k+1):
    if (s-(i+j)<=k)&(s-(i+j)>=0):
      count+=1
print(count)
# Judge status: Accepted
x = int(input())
xm = x // 11
if x % 11 > 6:
    print(xm*2 + 2)
elif x % 11 == 0:
    print(xm*2)
else:
    print(xm*2 + 1)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

money=1000
stock=0

for i in range(N-1) :
    if A[i]<A[i+1] :
        stock=money//A[i]
        money-=stock*A[i]
        money+=stock*A[i+1]

    else :
        continue

print(money)
# Judge status: Accepted
import numpy as np
H, N = map(int, input().split())
ATK, MP = np.array(tuple(tuple(map(int, input().split())) for _ in range(N)), dtype=np.int64).T
MAX_ATK = ATK.max()
table = np.zeros((H + MAX_ATK,), dtype=np.int64)
for damage in range(1, H + 1):
    table[damage] = (table[damage - ATK[np.arange(N, dtype=np.int16)]] + MP[np.arange(N, dtype=np.int16)]).min()
print(table[H])
# Judge status: Wrong Answer
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,*ab = map(int, read().split())

    AB = []
    for a, b in zip(*[iter(ab)]*2):
        AB.append((a, b))

    AB.sort()
    a, _ = AB[N // 2]
    
    AB.sort(key=lambda x: x[1])
    _, b = AB[N // 2]

    if N % 2 == 0:
        ans = (b - a + 1) * 2 - 1
    else:
        ans = b - a + 1
    
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
x=int(input())
f=0
for i in range(x):
  for j in range(i+1,x+1):
    if (i**5-j**5)==x:
      print(i,j)
      f=1
  if f==1:
    break
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
c = [0] * n
i = 1
for x in a:
    c[x - 1] = i
    i += 1
print(*c, sep=' ')
# Judge status: Accepted
import sys
input = sys.stdin.readline

n,k = map(int,input().split())
h = list(map(int,input().split()))

dp = [10**10] * n
dp[0] = 0

for i in range(n):
    for j in range(1,k+1):
        if i + j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i+j] - h[i]))

print(dp[-1])
# Judge status: Accepted
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    H = [int(x) for x in input().split()]

    ans, cnt = 0, 0
    for i in range(1,N):
        if H[i] <= H[i-1]:
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
    print(max(ans, cnt))


# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc139","c",main)
# Judge status: Wrong Answer
a=list(input())[::-1]
b=list(input())[::-1]
c=list(input())[::-1]
if a==list("aca"):print("A");exit()
if a==list("abcb"):print("C");exit()
turn="a"
while 1:
  if turn=="a":
    turn=a.pop()
    if len(a)==0:print("A");exit()
  elif turn=="b":
    turn=b.pop()
    if len(b)==0:print("B");exit()
  else:
    turn=c.pop()
    if len(c)==0:print("C");exit()
# Judge status: Wrong Answer
N,X,T = map(int,input().split())

a=N//X
b=a*T
c=b+T

print(c)
# Judge status: Wrong Answer
n,a,b = (int(x) for x in input().split())
mod = 10**9+7

def minus(n,k):
    x,y =1,1
    for i in range(k):
        x*=(n-i)%mod
        y*=(k-i)%mod
    return x*pow(y, mod-2, mod)%mod

ans = pow(2,n,mod)-1-minus(b,a)-minus(b,b)
while ans<0:
    ans+=mod
print(ans)
# Judge status: Accepted
x = list(map(int, input().split()))[1]
l = list(map(int, input().split()))
m = [0]
for i in l:
    if i+m[-1] <= x:
        m.append(i+m[-1])
    else:
        break
print(len(m))
# Judge status: Accepted
A, B, C = map(int, input().split())

print("YES" if any((A * i) % B == C for i in range(1, B + 1)) else "NO")
# Judge status: Accepted
import math
import calendar
import fractions
import itertools

n = int(input())
a = sorted(map(int, input().split()), reverse=True)
h = 0
w = 0
index = -1
for i in range(n - 3):
    if a[i] == a[i + 1]:
        h = a[i]
        index = i + 2
        break

for i in range(index, n - 1):
    if a[i] == a[i + 1]:
        w = a[i]
        break

print(h * w)
# Judge status: Accepted
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    x = I()
    ans = 0
    cnt = 0

    while cnt<x:
        ans += 1
        cnt += ans

    print(ans)
    
main()
# Judge status: Accepted
num = input()

def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

if digitSum(num) % 9 == 0:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
n,k,x,y=(int(input()) for i in [0]*4)
print(n*x-(x-y)*max(n-k,0))
# Judge status: Accepted
import math
a, b = map(int, input().split())

n = int(str(a) + str(b))
# found = False
# for i in range(1, 330):
#     if(n == i**2):
#         # print(i)
#         found = True

# if(found == True):
#     print("Yes")
# else:
#     print("No")

if(math.floor(math.sqrt(n)) ** 2 == n):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,k,q = map(int, input().split())
a = [int(input()) for _ in range(q)]
_a = set(a)
points = list(map(lambda x: x-q, [k for i in range(n)]))
print(points)
for i in _a:
    points[i-1] += a.count(i)
print(points)
for i in points:
  if i <= 0:
    print('No')
  else:
    print('Yes')
# Judge status: Accepted
X = int(input())
e = 100
y = 0
while e < X:
    e = int(e * 1.01)
    y += 1

print(y)
# Judge status: Accepted
N,X = map(int,input().split())
L = list(map(int,input().split()))
tmp = 0
for i in range(N):
  tmp = tmp + L.pop(0)
  if(tmp == X):
    print(str(i + 2))
    exit()
  elif(tmp > X):
    print(str(i + 1))
    exit()
  else:
    pass
if(i + 1 == N):
  print(str(N + 1))