Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

from functools import reduce
import sys
MOD = 1000000007
def culc(s, h, w, x, y):
	count = 1
	return count

h, w = map(int, input().split())
s = []
for i in range(h):
	s2 = input()
	s3 = []
	for j in range(len(s2)):
		s3.append(1 if s2[j] == "#" else 0)
	s.append(s3)

max = 0
left = [[0] * w for i in range(h)]
right = [[0] * w for i in range(h)]
up = [[0] * w for i in range(h)]
down = [[0] * w for i in range(h)]
for i in range(h):
	for j in range(w):
		left[i][j] = 0 if s[i][j] == 1 else 1 if j <= 0 else left[i][j - 1] + 1
		right[i][w - j - 1] = 0 if s[i][w - j - 1] == 1 else 1 if j <= 0 else right[i][w - j] + 1
		up[i][j] = 0 if s[i][j] == 1 else 1 if i <= 0 else up[i - 1][j] + 1
		down[h - i - 1][j] = 0 if s[h - i - 1][j] == 1 else 1 if i <= 0 else down[h - i][j] + 1
			
for i in range(h):
	for j in range(w):
		tmp = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3
		if max < tmp:
			max = tmp

print(max)


### FIXED CODE ###

from functools import reduce
import sys
import numpy as np
MOD = 1000000007

buffer = sys.stdin.buffer
H, W = list(map(int,buffer.readline().split()))
S = np.frombuffer(buffer.read(H*(W+1)), dtype="B") == ord(".")
S = S.reshape((H,W+1))[:,:-1]
L = np.empty((H,W), dtype="i4")
R = np.empty((H,W), dtype="i4")
U = np.empty((H,W), dtype="i4")
D = np.empty((H,W), dtype="i4")
 
L[:,0] = S[:,0]
for i in range(1,W):
    L[:,i] = (L[:,i-1] + 1) * S[:,i]
 
R[:,-1] = S[:,-1]
for i in range(1,W):
    R[:,-1-i] = (R[:,-i] + 1) * S[:,-1-i]
 
U[0] = S[0]
for i in range(1,H):
    U[i] = (U[i-1] + 1) * S[i]
 
D[-1] = S[-1]
for i in range(1,H):
    D[-1-i] = (D[-i] + 1) * S[-1-i]
 
score = L + R + U + D - 3
print(int(score.max()))
### BUGGY CODE ###

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

hlist=[]
for i in range(N):
  hlist.append(int(input()))
mh=max(hlist)
#print(mh,hlist)

def isOK(m):
  if m==0:
    return False
  
  hlist2=list(hlist)
  for i in range(N):
    hlist2[i]-=m*B
  #print(m,hlist2)
  if max(hlist2)<=0:
    return True
  
  cnt=0
  for i in range(N):
    if hlist2[i]>0:
      cnt+=-(-hlist2[i]//(A-B))
  return cnt<=m

l,r=1,mh//B+1
while l<=r:
  mid=(l+r)//2
  #print(l,mid,r)
  if not isOK(mid-1) and isOK(mid):
    print(mid)
    break
  elif isOK(mid-1):
    r=mid-1
  else:
    l=mid+1

### FIXED CODE ###

import sys
input=sys.stdin.readline
N,A,B=map(int,input().split())

hlist=[]
for i in range(N):
  hlist.append(int(input()))
mh=max(hlist)
#print(mh,hlist)

def isOK(m):
  if m==0:
    return False
  
  hlist2=list(hlist)
  for i in range(N):
    hlist2[i]-=m*B
  #print(m,hlist2)
  if max(hlist2)<=0:
    return True
  
  cnt=0
  for i in range(N):
    if hlist2[i]>0:
      cnt+=-(-hlist2[i]//(A-B))
  return cnt<=m

l,r=1,mh//B+1
while l<=r:
  mid=(l+r)//2
  #print(l,mid,r)
  if not isOK(mid-1) and isOK(mid):
    print(mid)
    break
  elif isOK(mid-1):
    r=mid-1
  else:
    l=mid+1
### BUGGY CODE ###

import itertools
import math

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

ab = []
for ax, bx in itertools.product(a, b):
    ab.append(ax+bx)
ab.sort(reverse=True)
s_ab = ab[:k[3]]

abc = []
for aby, cy in itertools.product(s_ab, c):
    abc.append(aby+cy)
abc.sort(reverse=True)
s_abc = abc[:k[3]]

for i in s_abc: print(i)


### FIXED CODE ###

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

A = sorted(a, reverse=True)[:k[3]]
B = sorted(b, reverse=True)[:k[3]]
C = sorted(c, reverse=True)[:k[3]]

ab = sorted(list(ax+bx for ax in A for bx in B), reverse=True)[:k[3]]
abc = sorted(list(aby+cy for aby in ab for cy in C), reverse=True)[:k[3]]
for i in abc: print(i)
### BUGGY CODE ###

inp = input().split()

# for i in range(1,1000000000000000000):
i = 1

while i <= 1000000000000000000:
	i *= int(inp[0])
	if i % int(inp[0])  == 0 and i % int(inp[1]) != 0:
		print(i)
		break

if i >= 1000000000000000000:
	print(-1)

### FIXED CODE ###

inp = input().split()

i = 1
x = 0

while i <= pow(10,18):
	if inp[0] == "1" and inp[1] == "1":
		print(-1)
		x = 1
		break
	if i % int(inp[0])  == 0 and i % int(inp[1]) != 0:
		print(i)
		x = 1
		break
	i *= int(inp[0])

if x == 0:
	print(-1)
### BUGGY CODE ###


def choose(D, c, s, d, last, depth, p):
    maxpoint = -999999
    maxnum = 0
    if depth > 0 and d < D:
        for i in range(26):
            point = p
            point += s[d][i]
            point += changepoint(c, d, i, last)
            nlast = []
            nlast.extend(last)
            nlast[i] = d
            z, point = choose(D, c, s, d+1, nlast, depth-1, point)
            if point > maxpoint:
                maxpoint = point
                maxnum = i
        return maxnum, maxpoint
    return 0, p


def changepoint(c, d, num, last):
    point = 0
    for j in range(26):
        if j != num:
            point -= c[j]*(d-last[j])
    return point


def main():
    D = int(input())
    c = list(map(int, input().split()))
    s = []
    last = [-1]*26
    for _ in range(D):
        s.append(list(map(int, input().split())))
    point = 0
    for i in range(D):
        num, point = choose(D, c, s, i, last, 2, 0)
        print(num+1)


main()


### FIXED CODE ###

def choose(D, c, s, d, last, depth, point):
    maxpoint = -999999
    maxnum = 0
    if depth > 0:
        for i in range(26):
            point = s[d][i]
            point += changepoint(c, d, i, last)
            if point >= maxpoint:
                maxpoint = point
                maxnum = i
        return maxnum, maxpoint
    return 0, 0


def changepoint(c, d, num, last):
    point = 0
    for i in range(26):
        if i == num:
            continue
        point -= c[i]*(d-last[i])
    return point


def main():
    D = int(input())
    c = list(map(int, input().split()))
    s = []
    last = [-1]*26
    for _ in range(D):
        s.append(list(map(int, input().split())))
    point = 0
    for i in range(D):
        num, point = choose(D, c, s, i, last, 1, point)
        print(num+1)


main()
### BUGGY CODE ###

import math




N=int(input())

anslist=[]
for i in range(1,N+1):
    ans=0
    if i<=5:
        anslist.append(ans)
    else:
        ma=int(math.sqrt(i))
        for x in range(1,ma):
            for y in range(x,ma):
                for z in range(y,ma):
                    if (x+y+z)**2<i:
                        continue
                    if x**2+y**2+z**2+x*y+y*z+z*x==i:
                        if x==y and y==z:
                            ans+=1
                        elif x==y or y==z or z==x:
                            ans+=3
                        else:
                            ans+=6
                    if 6*(x**2)>i:
                        break
        anslist.append(ans)
            

for i in range(N):
    print(anslist[i])

### FIXED CODE ###

import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

            
for i in range(1,N+1):
    print(anslist[i])
### BUGGY CODE ###

N = int(input())
S = input()

count = 0
for p in range(1000):
    v = format(p, '03')
    found = False
    for i in range(N):
        if S[i] == v[0]:
            p1 = i
            found = True
            break
    if not found:
        continue
    found = False
    for i in range(p1 + 1, N):
        if S[i] == v[1]:
            p2 = i
            found = True
            break
    if not found:
        continue
    found = False
    for i in range(p2 + 1, N):
        if S[i] == v[2]:
            p3 = i
            found = True
            break
    if not found:
        continue
    count += 1

print(count)


### FIXED CODE ###

N = int(input())
S = input()

count = 0
for p in range(1000):
    v = format(p, '03')
    found = False
    pos1 = S.find(v[0])
    if pos1 == -1:
        continue
    pos2 = S[pos1 + 1:].find(v[1])
    if pos2 == -1:
        continue
    pos3 = S[pos1 + pos2 + 2:].find(v[2])
    if pos3 == -1:
        continue
    count += 1

print(count)
### BUGGY CODE ###

import os
from collections import Counter, defaultdict

import math
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


# MOD = 998244353


def get_factors(n):
    """
    素因数分解
    :param int n:
    :rtype: list of int
    """
    if n <= 1:
        return []

    ret = []
    while n > 2 and n % 2 == 0:
        ret.append(2)
        n //= 2
    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            ret.append(i)
            n //= i
        else:
            i += 2
    ret.append(n)
    return ret


def get_divisors(n):
    """
    n の約数をリストで返す
    :param int n:
    :rtype: list of int
    """
    ret = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            ret.append(i)
            if n // i != i:
                ret.append(n // i)
    return ret


N = int(sys.stdin.buffer.readline())
A = list(map(int, sys.stdin.buffer.readline().split()))

memo = [None] * (max(A) + 1)

S = set(A)
counts = Counter(A)
ans = 0
for a in A:
    if counts[a] >= 2:
        continue
    if memo[a] is not None:
        ans += memo[a]
        continue
    ok = True
    for d in get_divisors(a):
        if d == a:
            continue
        ok &= d not in S
        if not ok:
            break
    ans += ok
    memo[a] = ok
print(ans)

exit()
factors = []
for a in A:
    fs = get_factors(a)
    factors.append(fs)
    for f in fs:
        counts[f] += 1

ans = 0
for i, a in enumerate(A):
    fs = factors[i]
    ok = True
    for k, v in Counter(fs).items():
        ok &= counts[k] == v
    ans += ok
    print(i, a, ok)
print(ans)

# TODO: 1


### FIXED CODE ###

import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


N = int(sys.stdin.buffer.readline())
A = list(map(int, sys.stdin.buffer.readline().split()))

counter = Counter(A)
A.sort()

dp = [True] * (max(A) + 10)
ans = 0
for a in A:
    if not dp[a]:
        continue
    if counter[a] == 1:
        ans += dp[a]
    j = a
    while j < len(dp):
        dp[j] = False
        j += a
print(ans)
### BUGGY CODE ###

L, R = map(int, input().split())
ans_l = []
for i in range(L,R):
    for j in range(i+1,R+1):
        ans = (i*j)%2019
        if ans !=0:
            ans_l.append(ans)
        else:
            ans_l.append(0)
            break;
print(min(ans_l))

### FIXED CODE ###

L, R = map(int, input().split())
ans_l = []
if R-L<2019:
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans = (i*j)%2019
            ans_l.append(ans)
    print(min(ans_l))
else:
    print(0)
### BUGGY CODE ###

N = int(input())
a_list = [int(i) for i in input().split()]

for i in range(1, N+1):
    print(a_list.count(i))

### FIXED CODE ###

N = int(input())
a_list = [i for i in input().split()]
result = [0 for i in range(1, N+1)]

for i in a_list:
    result[int(i)-1] += 1

for a in result:
    print(a)
### BUGGY CODE ###

import array
n, k = map(int, input().split())
tel = list(map(int, input().split()))
log = array.array('l', [1])
end = True
while(end):
    log.append(tel[log[-1] - 1])
    for i in range(len(log) - 1):
        if(log[i] == log[-1]):
            star = i
            mod = len(log) - star - 1
            end = False
if(k < len(log)):
    print(log[k])
else:
    print(log[(k - star) % mod + star])

### FIXED CODE ###

n, k = map(int, input().split())
tel = list(map(int, input().split()))
log = [1]
record = [0] * n
while(True):
    log.append(tel[log[-1] - 1])
    if(record[log[-1] - 1] == 1):
        break
    record[log[-1] - 1] += 1
for i in range(len(log) - 1):
    if(log[i] == log[-1]):
        star = i
        mod = len(log) - star - 1
        break
if(k < len(log)):
    print(log[k])
else:
    print(log[(k - star) % mod + star])
### BUGGY CODE ###

n, m = map(int,input().split())
 
for i in range(m):
    s,t = map(int,input().split())
    if i == 0:
        ans2 = [s,t+1]
    try:
        ans2 = [j for j in range(max(min(ans2),s),min(max(ans2)+1,t+1)) if s <= j <= t]
    except:
        break

print(len(ans2))


### FIXED CODE ###

n,m = map(int,input().split())

left_max = -1
right_min = n+1

for i in range(m):
    s,t = map(int,input().split())
    left_max = max(left_max,s)
    right_min = min(right_min, t)
    
print(max(0, right_min - left_max +1))
### BUGGY CODE ###

R, C = tuple(map(int, input().split()))
grid = [list(input()) for _ in range(R)]
dp = [[0 for _ in range(C)] for _ in range(R)]
for row in range(R):
    if grid[row][0] != '#':
        dp[row][0] = 1
    else:
        break

for col in range(C):
    if grid[0][col] != '#':
        dp[0][col] = 1
    else:
        break


def simplify(paths, MAX=10 ** 9 + 7):
    while paths > MAX:
        paths -= MAX
    return paths


def gridpaths(R, C, grid):
    for row in range(1, R):
        for col in range(1, C):
            if grid[row][col] != '#':
                dp[row][col] = dp[row - 1][col] + dp[row][col - 1]
        # print(dp)
    return simplify(dp[-1][-1])


print(gridpaths(R, C, grid))

### FIXED CODE ###

R, C = tuple(map(int, input().split()))
grid = [list(input()) for _ in range(R)]
dp = [[0 for _ in range(C)] for _ in range(R)]
for row in range(R):
    if grid[row][0] != '#':
        dp[row][0] = 1
    else:
        break

for col in range(C):
    if grid[0][col] != '#':
        dp[0][col] = 1
    else:
        break





def gridpaths(R, C, grid, MAX=10 ** 9 + 7):
    for row in range(1, R):
        for col in range(1, C):
            if grid[row][col] != '#':
                dp[row][col] = (dp[row - 1][col] + dp[row][col - 1])%MAX
        # print(dp)
    return dp[-1][-1]


print(gridpaths(R, C, grid))
### BUGGY CODE ###

def solve():
  n=int(input())
  arr1=list(map(int,input().split()))
  arr2=list(map(int,input().split()))
  m=min(arr2)
  tlist=[0]
  for val in arr1:
    tlist.append(tlist[-1]+val)
  t=tlist[-1]
  ans=0
  for i in range(1,2*t):
    tt=i/2
    if tt<=m or t-tt<=m:
      tmp=min(tt,t-tt)
    else:
      tmp=10**18
      for j in range(n):
        if tt<=tlist[j]:
          tmp=min(tmp,arr2[j]+(tlist[j]-tt))
        elif tlist[j+1]<=tt:
          tmp=min(tmp,arr2[j]+(tt-tlist[j+1]))
        else:
          tmp=min(tmp,arr2[j])
      tmp=min(tmp,tt)
      tmp=min(tmp,t-tt)
    ans+=tmp
  print(ans/2)
solve()

### FIXED CODE ###

def solve():
  n=int(input())
  arr1=list(map(int,input().split()))
  arr2=list(map(int,input().split()))
  tlist=[0]
  for val in arr1:
    tlist.append(tlist[-1]+val)
  t=tlist[-1]
  ans=0
  for i in range(1,2*t):
    tt=i/2
    tmp=10**18
    for j in range(n):
      if tt<=tlist[j]:
        tmp=min(tmp,arr2[j]+(tlist[j]-tt))
      elif tlist[j+1]<=tt:
        tmp=min(tmp,arr2[j]+(tt-tlist[j+1]))
      else:
        tmp=min(tmp,arr2[j])
    tmp=min(tmp,tt)
    tmp=min(tmp,t-tt)
    ans+=tmp
  print(ans/2)
solve()
### BUGGY CODE ###

N = int(input())
nCr = {}
def cmb(n, r):
    if n >= 2:
        if n - r < r: r = n - r
        if r == 0: return 1
        if r == 1: return n

        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]

        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot

        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])

        return result
    else:
        return 0

A = input().split()
len(set(A))
B = {}
C = {}
for i in set(A):
    B[i] = cmb(A.count(i) - 1, 2)
    C[i] = cmb(A.count(i), 2)
sC = sum(C.values())
for i in A:
    print(B[i] - C[i] + sC)


### FIXED CODE ###

n = int(input())

a = list(map(int, input().split()))
s = [0]*n
for i in range(n):
    s[a[i]-1] += 1
k = 0
for i in range(n):
    if s[i] >= 2:
        k += ((s[i]*(s[i]-1))//2)
for i in range(n):
    if s[a[i]-1] >= 2:
        print(k-(s[a[i]-1]-1))
    else:
        print(k)
### BUGGY CODE ###

import sys
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
ch=[]
for i in range(n):
    ch.append((a[i],i))
ch.sort(reverse=True)
#print(ch)
dp=[[0]*(n+1) for _ in range(n+1)]
dp[1][1]=ch[0][0]*ch[0][1]
dp[1][0]=ch[0][0]*(n-1-ch[0][1])
for i in range(2,n+1):
    for j in range(i+1):
        if j>=1:
            dp[i][j]=max(dp[i][j],dp[i-1][j-1]+ch[i-1][0]*abs(ch[i-1][1]-j+1))
        if i-1>=j:
            dp[i][j]=max(dp[i][j],dp[i-1][j]+ch[i-1][0]*abs(n-i+j-ch[i-1][1]))
print(max(dp[n]))   

### FIXED CODE ###

import sys
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
ch=[]
for i in range(n):
    ch.append((a[i],i))
ch.sort(reverse=True)
#print(ch)
dp=[[0]*(n+1) for _ in range(n+1)]
dp[1][1]=ch[0][0]*ch[0][1]
dp[1][0]=ch[0][0]*(n-1-ch[0][1])
for i in range(2,n+1):
    for j in range(i+1):
        if j>=1:
            dp[i][j]=max(dp[i][j],dp[i-1][j-1]+ch[i-1][0]*abs(ch[i-1][1]-j+1))
        if i-1>=j:
            dp[i][j]=max(dp[i][j],dp[i-1][j]+ch[i-1][0]*abs(n-i+j-ch[i-1][1]))
print(max(dp[n]))
### BUGGY CODE ###

import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()
import collections
N = int(input()) # 1行, 単数
A = list(map(int, input().split())) # 1行, 配列
Q = int(input()) # 1行, 単数
counter = collections.Counter(A)

while True:
  try:
    ans = 0
    B,C = list(map(int, input().split())) # 1行, 配列
    counter[C] = counter[C] + counter[B]
    del counter[B]
    for i in counter.keys():
      ans = ans + i * counter[i]
  # A = [C if i == B else i for i in A]
    print(ans)
  except:
    break;

### FIXED CODE ###

import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()
import collections
N = int(input()) # 1行, 単数
A = list(map(int, input().split())) # 1行, 配列
Q = int(input()) # 1行, 単数
counter = collections.Counter(A)
ans = 0
for i in counter.keys():
  ans = ans + i * counter[i]

while True:
  try:

    B,C = list(map(int, input().split())) # 1行, 配列
    old = C * counter[C] + counter[B] * B
    counter[C] = counter[C] + counter[B]
    del counter[B]
    new = C * counter[C]
    ans = ans + (new - old)
    print(ans)
  except:
    break;
### BUGGY CODE ###

n,m = map(int,input().split())
gates = []
for i in range(m):
	l,r = map(int,input().split())
	gates.append((l,r))
res = 0
L,R = gates[0]
if len(gates) < 2 :
	for i in range(1,n+1) :
		res += 1 if L<=i<=R else 0
	print(res)
else :
	for i in range(L,R+1) :
		flag =False
		for l,r in gates[1:] :
			if l<=i<=r :
				flag =True
			else :
				flag = False
		res += 1 if flag else 0
	print(res)

### FIXED CODE ###


n,m = map(int,input().split())
L = []
R = []
for i in range(m):
	l,r = map(int,input().split())
	L.append(l)
	R.append(r)

l = L[0]
r = R[0]
cnt = 0
for i in range(max(L),min(R)+1) :
	if 0<=i<=r :
		cnt += 1
print(cnt)
### BUGGY CODE ###

H, W = map(int, input().split())
maze = [input() for i in range(H)]
start_candidate = []
'''
. , #
'''

from collections import deque

direction = [
    (-1, 0),
    (0, -1),
    (1, 0),
    (0, 1)
]


def bfs(si, sj, gi, gj):
    reached = [[-1] * W for i in range(H)]
    reached[si][sj] = 0
    que = deque([[si, sj]])
    while que:
        i, j = que.popleft()
        for vi, vj in direction:
            ti, tj = i + vi, j + vj
            if ti < 0 or tj < 0 or ti > H - 1 or tj > W - 1:
                continue
            if maze[ti][tj] == '#' or reached[ti][tj] != -1:
                continue
            reached[ti][tj] = reached[i][j] + 1
            que.append([ti, tj])
        if reached[gi][gj] != -1:
            break
    return reached[gi][gj]


for i in range(H):
    for j in range(W):
        if maze[i][j] != '#':
            start_candidate.append([i, j])

from itertools import combinations

ans = 0
for c in combinations(start_candidate, 2):
    ans = max(ans, bfs(c[0][0], c[0][1], c[1][0], c[1][1]))
print(ans)


### FIXED CODE ###

H, W = map(int, input().split())
maze = [input() for i in range(H)]

direction = [
    (0, 1),
    (1, 0),
    (-1, 0),
    (0, -1)
]


def bfs(sy, sx):
    reached = [[-1] * W for _ in range(H)]
    reached[sy][sx] = 0
    from collections import deque
    que = deque([[sy, sx]])
    #d_max = 0
    while que:
        iy, ix = que.popleft()
        for d in direction:
            tx, ty = ix + d[0], iy + d[1]
            if tx >= W or ty >= H or tx < 0 or ty < 0:
                continue
            if reached[ty][tx] != -1 or maze[ty][tx] == '#':
                continue
            reached[ty][tx] = reached[iy][ix] + 1
            #d_max = max(reached[ty][tx], d_max)
            que.append([ty, tx])
    d_max = 0
    for i in range(H):
        for j in range(W):
            d_max = max(d_max,reached[i][j])

    return d_max


ans = 0

for i in range(H):
    for j in range(W):
        if maze[i][j] == '.':
            ans = max(ans, bfs(i, j))

# for i in range(H):
#     for j in range(i, W):
#         for k in range(H):
#             for l in range(k, W):
#                 if maze[i][j] == '#' or maze[k][l] == '#':
#                     continue
#                 else:
#                     ans = max(ans, bfs(i, j, k, l))
print(ans)
### BUGGY CODE ###

N = int(input())
H = list(map(int,input().split()))
maxMove = 0
tempoMove = 0
for i in range(N):
  for j in range(N-i-1):
    if i < maxMove:
      break
    if H[i+j]>=H[i+j+1]:
      tempoMove = tempoMove + 1
    else:
      break
  if tempoMove > maxMove:
    maxMove = tempoMove
    tempoMove = 0
  else:
  	tempoMove = 0
print(maxMove)

### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))
maxMove = 0
tempoMove = 0
for i in range(N):
  if N-len(range(i)) <= maxMove:
    break
  if tempoMove > 0:
    tempoMove = tempoMove - 1
    continue
  for j in range(N-i-1):
    if H[i+j]>=H[i+j+1]:
      tempoMove = tempoMove + 1
    else:
      break
  if tempoMove > maxMove:
    maxMove = tempoMove
print(maxMove)