Harryxun/stf_run huggingface dataset:
n=int(input())
s=list(input())

num=2**(n-1).bit_length()
st=[set() for _ in range(2*num)]

def update1(pos,x):
  pos+=num
  st[pos].add(x)
  while pos>=0:
    pos=(pos-1)//2
    st[pos]=st[2*pos+1]|st[2*pos+2]
    
def update2(pos,x):
  pos+=num
  st[pos].discard(x)
  while pos>=0:
    pos=(pos-1)//2
    st[pos]=st[2*pos+1]|st[2*pos+2]
    st[pos].discard(x)
    
def query(l,r):
  tl=l+num
  tr=r+num
  ret=set()
  while tl<tr:
    if tr&1==1:
      tr-=1
      ret=ret|st[tr-1]
    if tl&1==1:
      ret=ret|st[tl-1]
      tl+=1
    tl=tl//2
    tr=tr//2
  return len(ret)

for i in range(n):
  update1(i,s[i])

q=int(input())
for _ in range(q):
  a,b,c=map(str,input().split())
  a=int(a)
  b=int(b)
  if a==1:
    if c==s[b-1]:
      continue
    update2(b,s[b-1])
    s[b-1]=c
    update1(b,c)
  elif a==2:
    c=int(c)
    print(query(b,c+1))

### FIXED CODE ###

def ctoi(c):
  return ord(c)-97

n=int(input())
s=list(input())

bits=[[0]*(n+1) for _ in range(26)]

def query(pos):
  ret=[0]*26
  for i in range(26):
    tmp=0
    p=pos
    while p>0:
      tmp+=bits[i][p]
      p-=p&(-p)
    ret[i]=tmp
  return ret

def update(pos,a,x):
  while pos<=n:
    bits[a][pos]+=x
    pos+=pos&(-pos)

for i in range(n):
  update(i+1,ctoi(s[i]),1)

q=int(input())
for _ in range(q):
  flag,a,b=map(str,input().split())
  flag=int(flag)
  a=int(a)
  if flag==1:
    if s[a-1]==b:
      continue
    else:
      update(a,ctoi(s[a-1]),-1)
      update(a,ctoi(b),1)
      s[a-1]=b
  elif flag==2:
    b=int(b)
    cnt1=query(b)
    cnt2=query(a-1)
    ans=0
    for i in range(26):
      if cnt1[i]-cnt2[i]>0:
        ans+=1
    print(ans)
def main():
    import sys
    from collections import deque
    read=sys.stdin.read
    readline=sys.stdin.readline
    
    n, d, a = map(int, readline().split())
    m = map(int, read().split())
    monsters = sorted(zip(m, m), key=itemgetter(0))
    
    bomb_area = deque([])
    bomb_power = deque([])
    total_damage = 0
    ans = 0
    for pos, hp in monsters:
        while bomb_area:
            area = bomb_area[0]
            if area < pos:
                bomb_area.popleft()
                power = bomb_power.popleft()
                total_damage -= power
            else:
                break
        if hp <= total_damage:
            continue
        else:
            rest = hp - total_damage
            count = rest // a + (rest % a != 0)
            ans += count
            power = a * count
            total_damage += power
            bomb_area.append(pos + 2 * d)
            bomb_power.append(power)
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    import sys
    from collections import deque
    read=sys.stdin.read
    readline=sys.stdin.readline
    
    n, d, a = map(int, readline().split())
    m = map(int, read().split())
    monsters = sorted(zip(m, m), key=lambda x:x[0])
    
    bomb_area = deque([])
    bomb_power = deque([])
    total_damage = 0
    ans = 0
    for pos, hp in monsters:
        while bomb_area:
            area = bomb_area[0]
            if area < pos:
                bomb_area.popleft()
                power = bomb_power.popleft()
                total_damage -= power
            else:
                break
        if hp <= total_damage:
            continue
        else:
            rest = hp - total_damage
            count = rest // a + (rest % a != 0)
            ans += count
            power = a * count
            total_damage += power
            bomb_area.append(pos + 2 * d)
            bomb_power.append(power)
    print(ans)


if __name__ == '__main__':
    main()
N, M = map(int, input().split())
A = [input().split() for i in range(M)]
problems = {}
reject_count = 0
for P, S in A:
    if not problems.get(P) and P <= N:
        if S != 'AC':
            reject_count += 1
        else:
            problems[P] = S
print(len(problems), reject_count)

### FIXED CODE ###

N, M = map(int, input().split())
A = [input().split() for i in range(M)]
problems = {}
rejected = [0]*(N+1)
reject_count = 0
for P, S in A:
    P = int(P)
    if not problems.get(P):
        if S != 'AC':
            rejected[P] += 1
        else:
            problems[P] = S
for i in range(N+1):
    if problems.get(i):
        reject_count += rejected[i]
print(len(problems), reject_count)
import math
n,k=map(int,input().split()) 
lst=list()

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1, k+1):
    if n-k>i:
        lst.append(combinations_count(n-k+1, i) * combinations_count(k-i+(i-1), i-1))  
    elif n-k==i:
        lst.append(combinations_count(K-1,i-1))
    else:
        lst.append(int(0))

for i in range(k):
    print(lst[i]%(10**9+7))

### FIXED CODE ###

s=str(input())
lst=list(s)
lst.sort()
result = False

if lst[0] == lst[1]:
    if lst[1] != lst[2]:
        if lst[2] == lst[3]:
            result = True

if result:
    print('Yes')
else:
    print('No')
from collections import Counter
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')

n = I()
a = LI()
ans = 1000
kabu = 0
vs = list(Counter(a).keys())
i = 0
m = len(vs)
# 極小値で売る、極大値で買う
while i < m:
    if 0 < i < m - 1:
        if vs[i-1] > vs[i] < vs[i+1]:
            # 買う
            ans, kabu = ans % vs[i], ans // vs[i]
            # print(i, ans, kabu)

        elif vs[i-1] < vs[i] > vs[i+1]:
            # 売る
            ans, kabu = ans + vs[i] * kabu, 0
            # print(i, ans, kabu)
    else:
        if i == 0:
            if vs[i] < vs[i+1]:
                # 買う
                ans, kabu = ans % vs[i], ans // vs[i]
                # print(i, ans, kabu)
        else:
            if vs[i - 1] < vs[i]:
                # 売る
                ans, kabu = ans + vs[i] * kabu, 0
                # print(i, ans, kabu)
    i += 1
# print(i)

print(ans)


### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')

n = I()
a = LI()
ans = 1000
for i in range(n - 1):
    kabu = 0
    if a[i] < a[i+1]:
        # 出来るだけ買う
        kabu = ans // a[i]
    # 買った株があれば i + 1日目 に売る
    if kabu > 0:
        ans += (a[i + 1] - a[i]) * kabu
print(ans)
N,M=map(int,input().split())
acs=[0 for i in range(N)]
wa=[0 for i in range(N)]

for  i in range(M):
    p,S=map(str,input().split())
    p=int(p)
    if S=='AC':
        acs[p-1]=1
    elif S=='WA' and acs[p-1]==0: 
        wa[p-1]+=1
for i in range(M):
    if acs[i]==0:
        wa[i]=0
ans=[sum(acs),sum(wa)]


### FIXED CODE ###

N,M=map(int,input().split())
acs=[0 for i in range(N)]
wa=[0 for i in range(N)]

for  i in range(M):
    p,S=map(str,input().split())
    p=int(p)
    if S=='AC':
        acs[p-1]=1
    elif S=='WA' and acs[p-1]==0: 
        wa[p-1]+=1
for i in range(N):
    if acs[i]==0:
        wa[i]=0
ans=[sum(acs),sum(wa)]
print(*ans)
L, R = map(int, input().split())
results = []
for n in range(1):
    if diff > 2019:
        ret = 0
        break
    for i in range(L, R):
        for j in range(i+1,R+1):
            results.append((i*j)%2019)
        ret = min(results)
print(ret)

### FIXED CODE ###

L, R = map(int, input().split())
diff = R-L
for n in range(1):
    if diff > 2019:
        ret = 0
        break
        
        [inner for outer in init for inner in outer]
    ret = min([ (i*j)%2019 for i in range(L, R) for j in range(i+1,R+1) ])
print(ret)
N,L = map(int,input().split())
s = []
for i in range(N):
    s.append(L+i)
ans_pre = abs(np.array([s]))
if L + N < 0:
    print(-1*(sum(ans_pre[0])-min(ans_pre[0])))
else:
    print(sum(s)-min(ans_pre[0]))

### FIXED CODE ###

import numpy as np
N,L = map(int,input().split())
s = []
for i in range(N):
    s.append(L+i)
ans_pre = abs(np.array([s]))
if L + N <= 0:
    print(-1*(sum(ans_pre[0])-min(ans_pre[0])))
else:
    print(sum(s)-min(ans_pre[0]))
from collections import deque

(n, m, k), aa, bb = [deque(map(int, l.split())) for l in open(0)]

i = 0

while k - min(aa[0], bb[0])>0:
    if aa[0]>bb[0]:
        k -= bb.popleft()
        i+=1
    else:
        k -= aa.popleft()
        i+=1

print(i)

### FIXED CODE ###

from collections import deque

(n, m, k), aa, bb = [list(map(int, l.split())) for l in open(0)]

from itertools import accumulate

aaa = list(zip(list(accumulate([0]+aa)), range(len(aa)+1)))
bbb = list(zip(list(accumulate([0]+bb)), range(len(bb)+1)))

i = 0
j = len(bb)

ans = 0

while i<len(aaa) and j >= 0:
    aco, abo = aaa[i]
    bco, bbo = bbb[j]
    if aco+bco > k:
        j -= 1
        continue
    else:
        ans = max(abo+bbo, ans)
        i += 1

print(ans)
n,k=map(int,input().split())
mon=list(map(int,input().split()))
mon.sort(reverse=True)
for i in range(k):
  mon.pop(0)
print(sum(mon))
  


### FIXED CODE ###

h,a=map(int,input().split())
ans=h//a+1
if h%a==0:
  ans-=1
print(ans)
n = int(input())
a = list(map(int, input().split()))

l = []
for i in range(1, n + 1):
    l.append([a[i - 1], i])

l.sort()

res = str(l[0][1])
for i in range(1, n):
    res = res + " " + str(l[0][i])
print(res)


### FIXED CODE ###

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

l = []
for i in range(1, n + 1):
    l.append([a[i - 1], i])

l.sort()

print(" ".join([str(l[i][1]) for i in range(0, n)]))
# -*- coding: utf-8 -*-
N = int(input())
S = list(str(input()))
K = int(input())

for i in range(N):
    if S[i] != S[K]:
        S[i] = "*"
"".join(S)
print(S)


### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())
S = list(str(input()))
K = int(input())

for i in range(N):
    if S[i] != S[K - 1]:
        S[i] = "*"

Z = ''.join(S)
print(Z)
ans = []
for i in range(n):
  for j in range(n-1):
    if j >= i:
      if a[j]-a[i] <= 2:
        #print(i,j)
        count += 1
      else:
        if count != 0:
          ans.append(count)
        count = 0
        i += 1
    else:
      continue
if n == 1:
  print(1)
else:
  print(max(ans))

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
a.sort()
count = 0
p1 = []
for i in range(n):
  p1.append(a[i]-1)
p2 = []
for i in range(n):
  p2.append(a[i]+1)
chk = a+p1+p2
chk.sort()
#print(chk)
ans =[]
count = 0
for i in range(3*n-1):
  if chk[i+1] == chk[i]:
    count += 1
  else:
    ans.append(count)
    count = 0
print(max(ans)+1)
import itertools
import numpy as np

X = int(input())
maxs = int(X**(1/5))

l = np.arange(-maxs, maxs+1)

comb = np.array(list(itertools.combinations_with_replacement(l, 2)))

sum1 = comb[:, 0]**5 - comb[:, 1]**5
sum2 = comb[:, 1]**5 - comb[:, 0]**5

try:
    result1 = np.where(sum1==X)[0][0]
    print(comb[result1][0], comb[result1][1])
except:
    result2 = np.where(sum2==X)[0][0]
    print(comb[result2][1], comb[result2][0])

### FIXED CODE ###

import itertools
import numpy as np

X = int(input())
maxs = int(X**(1/5))

l = np.arange(-126, 127)

comb = np.array(list(itertools.combinations_with_replacement(l, 2)))

sum1 = comb[:, 0]**5 - comb[:, 1]**5
sum2 = comb[:, 1]**5 - comb[:, 0]**5

if len(np.where(sum1==X)[0]) != 0:
    result1 = np.where(sum1==X)[0][0]
    print(comb[result1][0], comb[result1][1])
else:
    result2 = np.where(sum2==X)[0][0]
    print(comb[result2][1], comb[result2][0])
N=int(input())
lst=[int(i) for i in input().split()]
import numpy
res=numpy.cumsum(lst)
ans=10e10
for i in range(N):
  ans=min(ans,abs(res[i]-(res[-1]-res[i])))
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
  print('Possible')
else:
  print('Impossible')
n = int(input())
t = [int(input()) for _ in range(n)]

if n == 1:
    print(t[0])
    exit()
# 最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
    return a * b / gcd(a, b)
res = lcm(t[0], t[1])
for i in range(2, n):
    res = lcm(res, t[i])
print(int(res))


### FIXED CODE ###

n = int(input())
t = [int(input()) for _ in range(n)]

# 最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)
res = 1
for i in range(n):
    res = lcm(res, t[i])
print(res)
s = list(input())
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if 0<a<13 and 0<b<13:
    print('AMBIGUOUS')
elif 0<a<13:
    print('MMYY')
elif 0<b<13:
    print('YYMM')
else:
    print('NA')


### FIXED CODE ###

n,k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))
# coding: utf-8

############################

x,n = map(int,input().split())
p_list = list(map(int,input().split()))

if n==0:
    print(x)
    exit()


z=101
pp_list = [i for i in range(min(p_list),max(p_list)+1)]

for j in p_list:
    pp_list.remove(j)

for k in pp_list:
    zettaiti = abs(x-k)

    if z > zettaiti:
        z = zettaiti
        ans = k

print(ans)

### FIXED CODE ###

# coding: utf-8

############################

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

if n==0:
    print(x)
    exit()

z=101
p_list = list(map(int,input().split()))
pp_list = [i for i in range(102)]

for j in p_list:
    pp_list.remove(j)

for k in pp_list:
    zettaiti = abs(x-k)

    if z > zettaiti:
        z = zettaiti
        ans = k

print(ans)
# coding: utf-8
import time
import re
import math
 
def main():
    N,K=map(int,input().split())
    A=list(map(int,input().split()))
    count=0
    for l in range(N):
        start=0
        for r in range(l,N):
            start+=A[r]
            if start>=K:
                
                count+=N-r
                break
    print(count)
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#"YNeos"[True::2]
#A=list(map(int,input().split()))
#n=int(input())
# global n,A,s,memo,mx,mn,L,B

### FIXED CODE ###

# coding: utf-8
import time
import re
import math

def main():
    w,h,x,y=map(int,input().split())
    f=0
    if w/2==x and h/2==y:
        f=1
    print("{} {}".format(w*h/2,f))
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#"YNeos"[True::2]
#A=list(map(int,input().split()))
#n=int(input())
# global n,A,s,memo,mx,mn,L,B
import collections
n, m  = [int(i) for i in input().split(' ')] 
edges = collections.defaultdict(list)
for i in range(m):
    s,d = [int(i) for i in input().split(' ')] 
    edges[s-1].append(d-1) 
dp = [-1]*n

# global maxPath
maxPath = 0 
def dfs(node): 
    # nonlocal maxPath
    global maxPath
    if dp[node]>=0:
        return dp[node]+1  
    ans = 0 
    for i in edges[node]: 
        ans = max(ans,dfs(i))
    dp[node] = ans
    maxPath = max(maxPath, ans) 
    return ans+1 
for i in range(n):
    dfs(i)
print(maxPath)


### FIXED CODE ###

import collections
import sys
from functools import lru_cache
sys.setrecursionlimit(int(10**9))
n, m  = [int(i) for i in input().strip().split(' ')] 
edges = collections.defaultdict(list)
for i in range(m):
    s,d = [int(i) for i in input().strip().split(' ')]
    edges[s-1].append(d-1) 
# dp = [-1]*n
maxPath = 0 
@lru_cache(None)
def dfs(node): 
    ans = 0 
    for i in edges[node]:
        ans = max(ans,dfs(i)+1)
    return ans

for i in range(n):
    maxPath = max(dfs(i), maxPath) 
print(maxPath)
import sys

input = lambda: sys.stdin.readline().rstrip()

n, m, k = map(int, input().split())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))

cnt = 0
if A[0] < B[0] and A[0] <= k:
    cnt += 1
    k -= A[0]

idx_a = 1
idx_b = 0
while k >= 0:
  if B[idx_b] > A[idx_a]:
    k -= A[idx_a]
    if k >= 0: cnt += 1
    if idx_a < n-1: idx_a += 1

  else:
    k -= B[idx_b]
    if k >= 0: cnt += 1
    if idx_b < m-1: idx_b += 1
        
print(cnt)

### FIXED CODE ###

from itertools import accumulate

n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A = [0] + A
A = list(accumulate(A))

B = [0] + B
B = list(accumulate(B))

ans = 0
b_cnt = m
for a_cnt in range(n+1):
    if A[a_cnt] > k: continue

    while A[a_cnt]+B[b_cnt] > k:
        b_cnt -= 1
    ans = max(ans, a_cnt+b_cnt)

print(ans)
#include<stdio.h>

int main() {
	int n, Yellow_exists, i;
	char str[101];
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%c", &str[i]);
	}

	Yellow_exists = 0;
	for (i = 0; i < n; i++) {
		if (str[i] == 'Y') {
			Yellow_exists = 1;
			break;
		}
	}

	printf(Yellow_exists ? "Four" : "Three");
	return 0;
}

### FIXED CODE ###

input()
a = input()
print("Four" if 'Y' in a else "Three")
import sys
import numpy as np
readline = sys.stdin.buffer.readline

def main():
    N = int(readline())
    B = np.array(readline().split(), np.int64)
    A = np.eye(N, dtype=np.int64) + np.eye(N, k=1, dtype=np.int64)
    A[N-1][0] = 1
    ans = np.linalg.solve(A, B).astype(np.int64) * 2
    print(' '.join(map(str, ans)))

if __name__ == '__main__':
    main()

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
x = [0] * N
x[0] = sum([a[i] for i in range(N) if i % 2 == 0]) - sum([a[i] for i in range(N) if i % 2 != 0])
for i in range(N - 1):
    x[i + 1] = 2 * a[i] - x[i]
print(*x)
N,A,B=map(int,input())
print(min(N*A,B))


### FIXED CODE ###

N,A,B=map(int,input().split())
print(min(N*A,B))
# 今日の曜日を表す文字列 Sが与えられます。
# Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
# それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。
# 次の日曜日 (あす以降) が何日後か求めてください。

# 標準入力から曜日（S）を取得する
input_weekday = input()

# 次の日曜日はあと何日後かを計算して出力する
resut = 0
if input_weekday == 'SUN':
    result = 7
elif input_weekday == 'MON':
    result = 6
elif input_weekday == 'TUE':
    result = 5
elif input_weekday == 'WED':
    resut = 4
elif input_weekday == 'THU':
    result = 3
elif input_weekday == 'FRI':
    resut = 2
elif input_weekday == 'SAT':
    result = 1

print(result)


### FIXED CODE ###

# 今日の曜日を表す文字列 Sが与えられます。
# Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
# それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。
# 次の日曜日 (あす以降) が何日後か求めてください。

# 標準入力から曜日（S）を取得する
input_weekday = input()

# 次の日曜日はあと何日後かを計算して出力する
result = 0
if input_weekday == 'SUN':
    result = 7
elif input_weekday == 'MON':
    result = 6
elif input_weekday == 'TUE':
    result = 5
elif input_weekday == 'WED':
    result = 4
elif input_weekday == 'THU':
    result = 3
elif input_weekday == 'FRI':
    result = 2
elif input_weekday == 'SAT':
    result = 1

print(result)
n = int(input())
p = map(int, input().split())
m = 1

if n > 1:
    for i, pi in enumerate(p):
        if pi <= i:
            continue
        elif all([pj >= pi for pj in p[:i]]):
            m += 1
        else:
            continue

print(m)


### FIXED CODE ###

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

q = p[0]
p = p[1:]

m = 1

if n > 1:
    for pi in p:
        if q > pi:
            m += 1
            q = pi

print(m)
print( (int(input()) + int(input()) * int(input()) // 2)

### FIXED CODE ###

print((int(input()) + int(input())) * int(input()) // 2)
N = int(input())
A = list(map(int, input().split(" ")))
dp = dict()
mod = 10 ** 9 + 7

def f(i, r, b, g):
    if i == N:
        return 1
    if (i, r, b, g) in dp:
        return dp[(i, r, b, g)]
    ans = 0
    # iがr, b, gを被って矛盾がないかを見ていく
    if A[i] == r:
        ans += f(i + 1, r + 1, b, g)
    if A[i] == b:
        ans += f(i + 1, r, b + 1, g)
    if A[i] == g:
        ans += f(i + 1, r, b, g + 1)

    dp[(i, r, b, g)] = ans % mod
    return ans

print(f(0, 0, 0, 0) % mod)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())
A = list(map(int, input().strip().split(" ")))
dp = {i: dict() for i in range(N)}
mod = 10 ** 9 + 7

def f(i, ma, mi):
    if i == N:
        return 1
    if (ma, mi) in dp[i]:
        return dp[i][(ma, mi)]
    if A[i] != ma and A[i] != mi and A[i] != i - ma - mi:
        dp[i][(ma, mi)] = 0
        return 0

    ans = 0
    # iがr, b, gを被って矛盾がないかを見ていく
    if A[i] == ma:
        ans += f(i + 1, ma + 1, mi)
    if A[i] == mi:
        if ma > mi + 1:
            ans += f(i + 1, ma, mi + 1)
        else:
            ans += f(i + 1, mi + 1, ma)
    if A[i] == i - ma - mi:
        ans += f(i + 1, ma, mi)

    dp[i][(ma, mi)] = ans % mod
    return ans % mod

print(f(0, 0, 0) % mod)
30
0 0 0 0 2 3 3 3 4 5 6 7 8 8 8 9 9 9 10 11 11 12 12 12 12 13 13 7000000 500000000 1000000000
16
2 0 5 11 3 16 4 6 1 10 7 14 15 7000000 9 5555555

### FIXED CODE ###

#coding:UTF-8
def BS(n,S,q,T):
    count=0
    for i in range(q):
        left=0
        right=n
        while left < right:
            mid=int((left+right)/2)
            if S[mid]==T[i]:
                count+=1
                break
            elif T[i]<S[mid]:
                right=mid
            else:
                left=mid+1
        
    print(count)
  
if __name__=="__main__":
    n=int(input())
    S=input().split(" ")
    for i in range(n):
        S[i]=int(S[i])
    q=int(input())
    T=input().split(" ")
    for i in range(q):
        T[i]=int(T[i])
    BS(n,S,q,T)
N = int(input())
A = list(map(int, input().split()))

ans = 1
up,down = False,False
for i in range(N-1):
  if A[i] < A[i+1]:
    up = True
  elif A[i] > A[i+1]:
    down = True
  if up and dn:
    ans +=1
    up,down = False,False
    
print(ans)

### FIXED CODE ###

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

ans = 1
up, dn = False, False
for i in range(N-1):
    if A[i] < A[i+1]:
        up = True
    elif A[i] > A[i+1]:
        dn = True
    if up and dn:
        ans += 1
        up, dn = False, False
print(ans)
import numpy as np
import sys
sys.setrecursionlimit(10000)
def culc(s,x,m,F_array,eat_time):
   
    K_sum = eat_time/F_array
    must_del = K_sum[K_sum > x]
    must_del = must_del - x
    sum_del = int(np.sum(must_del))
    print(x)
    print(sum_del)
    if sum_del == x:
        return x

    if sum_del > x:
        s = x
        x = int((x+m)/2)
        return culc(s,x,m,F_array,eat_time)
    else:
        m = x
        x = int((x+s)/2)
        return culc(s,x,m,F_array,eat_time)


import numpy as np
N,K = map(int,input().split())
A_list =  list(map(int, input().split()))
F_list =  list(map(int, input().split()))
s = 0
m = 1.0e+18
x = 5.0e+17
eat_time = []
A_list.sort() #min max
F_list.sort(reverse=True) #max -min

A_array = np.array(A_list)
F_array = np.array(F_list)
eat_time =A_array*F_array

print(culc(s,x,m,F_array,eat_time))

### FIXED CODE ###

x,y=map(int,input().split())
if x<10 and y<10:
    print(x*y)
else:
    print("-1")
N,M = map(int, input().split())

ans = [0] * M

for i in range(M):
    a, b = map(int, input().split())
    ans[a-1] += 1
    ans[b-1] += 1

print(*ans, sep='\n')

### FIXED CODE ###

N, M = map(int, input().split())

a = [0] * M
b = [0] * M
for i in range(M):
    a[i],b[i] = map(int, input().split())

for i in range(1, N+1):
    print(a.count(i) + b.count(i))
N = int(input())
H = list(map(int, input().split()))

ans = 0
i = 1
now = H[0]
count = 0

while True:
    if now >= H[i]:
        count += 1
        now = H[i]
    else:
        ans = max(count, ans)
        now = H[i]
        count = 0
    
    now = H[i]
    i += 1

    if i >= len(H):
        ans = max(ans, count)
        break

print(ans)


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))

def f():
    ans = 0
    i = 1
    now = H[0]
    count = 0

    if N <= 1:
        return 0
    else:
        while True:
            if now >= H[i]:
                count += 1
                now = H[i]
            else:
                ans = max(count, ans)
                now = H[i]
                count = 0
            
            now = H[i]
            i += 1

            if i >= len(H):
                ans = max(ans, count)
                break

        return ans

print(f())