Harryxun/stf_run huggingface dataset:
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


# import re
# import array
# import copy
# import functools
# import operator

import math
# import string
import fractions
# from fractions import Fraction
from fractions import gcd

# import collections
# import itertools
# import bisect

# import heapq
# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace
# from queue import PriorityQueue as pq
from queue import Queue

# from itertools import accumulate

# from collections import deque
# from collections import Counter

from operator import mul
from functools import reduce

# def lcm(n,m):
#     return int(n*m/gcd(n,m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


# import random
# import time


def main():
    h = int(input().strip())
    t_height = math.log2(h)
    eprint("t_height ", end=": ")
    eprint(math.ceil(t_height))
    t_height = math.ceil(t_height)
    print(2**(t_height) - 1)
    return


if __name__ == '__main__':
    main()


### FIXED CODE ###

from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    n = int(input().strip())

    def rec(m,j):
        if m==0:
            return 0
        else:
            return 2**j + rec(m//2,j+1)
            
        
    print(rec(n,0))

if __name__ == '__main__':
    main()
_,s,*a=map(int,open(0).read().split())
c,i,*d=[0]*s*5
for a in a:
 for j in range(s,0,-1):d[a+j]+=d[j]
 d[a]-=~i;c+=d[s];i+=1
print(c%(998244353))

### FIXED CODE ###

n,s,*a=map(int,open(0).read().split())
d=[0]*3001
c=0
for i,a in enumerate(a):
    for j in range(s-a,0,-1):d[a+j]+=d[j]
    d[a]-=~i
    c+=d[s]
print(c%(998244353))
N = int(input())

A = [int(input()) for _ in range(N)]
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)

### FIXED CODE ###

a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")
inport sys

x = sys.stdin.readline()

a, b = x.split(" ")

S = a * b
l = 2 * (a + b)

print S,l

### FIXED CODE ###

import sys

x = sys.stdin.readline()

a, b = x.split(" ")

a = int(a)
b = int(b)

S = a * b
l = 2 * (a + b)

print '%d %d' % (S,l)
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def ti(): return tuple(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

from functools import reduce

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

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def table(n:int, p=10**9+7):
    global fact, factinv, inv
    fact = [1, 1]
    factinv = [1, 1]
    inv = [0, 1]
    for i in range(2, n+1):
        fact.append((fact[-1] * i) % p)
        inv.append((-inv[p % i] * (p // i)) % p)
        factinv.append((factinv[-1] * inv[-1]) % p)

def main():
    N = ii()
    A = ti()
    P = 10**9 + 7
    lcm_a = lcm(A) % P

    #逆元テーブルの作成
    N = 10**6+1
    inv_t = [0]+[1]
    for i in range(2,N):
        inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

    ans = 0
    for num in A:
        ans = (ans + inv_t[num] * lcm_a) % P
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def ti(): return tuple(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

from functools import reduce

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

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

def table(n:int, p=10**9+7):
    global fact, factinv, inv
    fact = [1, 1]
    factinv = [1, 1]
    inv = [0, 1]
    for i in range(2, n+1):
        fact.append((fact[-1] * i) % p)
        inv.append((-inv[p % i] * (p // i)) % p)
        factinv.append((factinv[-1] * inv[-1]) % p)

def main():
    N = ii()
    A = ti()
    P = 10**9 + 7
    lcm_a = lcm(A) % P

    N = 10**6+1
    inv_t = [0]+[1]
    for i in range(2,N):
        inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

    #print(inv_t[:10])
    ans = 0
    for num in A:
        ans = (ans + inv_t[num] * lcm_a) % P
        #ans +=  (ans + lcm_a // num) % P
        #ans %= inf
    print(ans)

if __name__ == "__main__":
    main()
N = int(input())

ans = ''
while N != 0:
    r = N % 2
    N = (N - r) / (-2)
    ans += r

ans[::-1]
if N == 0:
    ans = '0'
    
print(ans)

### FIXED CODE ###

N = int(input())

ans = ''
while N != 0:
    r = N % 2
    N = (N - r) // (-2)
    ans += str(r)

ans = ans[::-1]
if ans == '':
    ans = '0'

print(ans)
X,N=map(int,input().split())
if N==0:
  print(X)
  exit()
P=list(map(int,input().split()))
nP=[]
min=10**15
for i in range(1,101):
  if i not in P:
    nP.append(i)
anlist=[]
for i in nP:
  if min>abs(i-X):
    min=abs(i-X)
    anlist.append(i)
print(anlist[-1])

### FIXED CODE ###

X,N=map(int,input().split())
if N==0:
  print(X)
  exit()
P=list(map(int,input().split()))
nP=[]
min=10**15
for i in range(-200,200):
  if i not in P:
    nP.append(i)
anlist=[]
for i in nP:
  if min>abs(i-X):
    min=abs(i-X)
    anlist.append(i)
print(anlist[-1])
from scipy.misc import comb
c=Counter()
n,m=map(int,input().split())
t=2
while t*t<=m:
    if m%t:
        t+=1
        continue
    while m%t==0:
        c[t]+=1
        m//=t
if m>1:c[m]+=1
a=1
for i in c:
    a=a*comb(n+c[i]-1,n-1,exact=1)%(10**9+7)
print(a)

### FIXED CODE ###

import math
import random
from scipy.misc import comb
class Prime:
    seed_primes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]
    def is_prime(self,n):
        is_prime_common=self.is_prime_common(n)
        if is_prime_common is not None:return is_prime_common
        if n<2000000:return self.is_prime_brute_force(n)
        return self.is_prime_miller_rabin(n)
    def is_prime_common(self,n):
        if n==1:return False
        if n in Prime.seed_primes:return True
        if any(map(lambda x:n%x==0,self.seed_primes)):return False
    def is_prime_brute_force(self,n):
        for k in range(2,int(math.sqrt(n))+1):
            if n%k==0:return False
        return True
    def is_prime_miller_rabin(self,n):
        d=n-1
        while d&1==0:d>>=1
        witnesses=self.get_witnesses(n)
        for w in witnesses:
            y=pow(w,d,n)
            while d!=n-1and y!=1and y!=n-1:
                y=y*y%n
                d<<=1
            if y!=n-1and d&1==0:return False
        return True
    def get_witnesses(self,num):
        def _get_range(num):
            if num<2047:return 1
            if num<1373653:return 2
            if num<25326001:return 3
            if num<3215031751:return 4
            if num<2152302898747:return 5
            if num<3474749660383:return 6
            if num<341550071728321:return 7
            if num<3825123056546413051:return 9
            return 12
        return self.seed_primes[:_get_range(num)]
    def gcd(self,a,b):
        if a<b:return self.gcd(b,a)
        if b==0:return a
        while b:a,b=b,a%b
        return a
    @staticmethod
    def f(x,n,seed):
        p=Prime.seed_primes[seed%len(Prime.seed_primes)]
        return(p*x+seed)%n
    def find_factor(self,n,seed=1):
        if self.is_prime(n):return n
        x,y,d=2,2,1
        count=0
        while d==1:
            count+=1
            x=self.f(x,n,seed)
            y=self.f(self.f(y,n,seed),n,seed)
            d=self.gcd(abs(x-y),n)
        if d==n:
            return self.find_factor(n,seed+1)
        return self.find_factor(d)
    def find_factors(self,n):
        primes={}
        if self.is_prime(n):
            primes[n]=1
            return primes
        while n>1:
            factor=self.find_factor(n)
            primes.setdefault(factor,0)
            primes[factor]+=1
            n//=factor
        return primes
n,m=map(int,input().split())
a=1
for c in Prime().find_factors(m).values():
    a=a*comb(n+c-1,c,exact=1)%(10**9+7)
print(a)
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

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

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


#2:26
n,a,b = list(map(int, input().split()))
ans=[]
if(n<a+b-1 or n>a*b):
    print(-1)
else:
    x = (n-a)//(b-1)
    y = (n-a)%(b-1)
    times=[0 for i in range(b-1)]
    for i in range(a):
        ans.append(n-a+i+1)
    for i in range(b-1):
        if(i<y):
            times[i]=x+1
        else:
            times[i]=x
    now = n-a
    for i in range(b-1):
        now -= times[i]
        for j in range(times[i]):
            ans.append(now+j+1)
print(' '.join(map(str,ans)))

### FIXED CODE ###

import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

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

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


#2:26
n,a,b = list(map(int, input().split()))
ans=[]
if(n<a+b-1 or n>a*b):
    print(-1)
else:
    if(b>=2):
        x = (n-a)//(b-1)
        y = (n-a)%(b-1)
    else:
        x=1
        y=1
    times=[0 for i in range(b-1)]
    for i in range(a):
        ans.append(n-a+i+1)
    for i in range(b-1):
        if(i<y):
            times[i]=x+1
        else:
            times[i]=x
    now = n-a
    for i in range(b-1):
        now -= times[i]
        for j in range(times[i]):
            ans.append(now+j+1)
print(' '.join(map(str,ans)))
import sys
x = sys.argv[1]
x = x**3
print(x)

### FIXED CODE ###

a = input()
print(int(a)**3)
while True:
    n = int(input())
    if n == 0:
        break
    a = [int(input()) for _ in range(n)]
    d = [a[0]]
    for i in range(n):
        if d[0] == 0:
            d[0] += a[i]
        elif a[i] / d[-1] >= 0:
            d[-1] += a[i]
        else:
            d.append(a[i])
    if d[0] < 0:
        d.pop(0)
    if d == []:
        print(max(a))
    if len(d) <= 2:
        print(max(d))
    else:
        maxd = max(d)
        for i in range(0, len(d), 2):
            for j in range(i + 1, len(d) + 1, 2):
                maxd = max(maxd, sum(d[i:j]))
        print(maxd)


### FIXED CODE ###

from collections import deque
while True:
    n = int(input())
    if n == 0:break
    a = [int(input()) for _ in range(n)]
    b = deque([0] * n)
    j = 0
    for i in range(n):
        if a[i] * b[j] >= 0:b[j] += a[i]
        else:j += 1;b[j] += a[i]
    if b[0] < 0 and len(b) > 1:b.popleft()
    while b[-1] <= 0 and len(b) > 1:b.pop()
    if len(b) == 1 and b[0] <= 0:print(max(a))
    else:
        m = len(b) // 2 + 1
        v = [[0] * m for _ in range(m)]
        v[0][0] = b[0]
        for i in range(1, m):
            v[0][i] = v[0][i - 1] + b[2 * i] + b[2 * i - 1]
        for i in range(1, m):
            for j in range(i, m):
                v[i][j] = v[i - 1][j] - b[2 * i - 2] - b[2 * i - 1]
        print(max([max(i) for i in v]))
a=int(input())
b=int(input())
if a>b:
  print('GREATER')
elif a=b:
  print('EQUAL')
else:
  print('LESS')

### FIXED CODE ###

a=int(input())
b=int(input())
if a>b:
  print('GREATER')
elif a==b:
  print('EQUAL')
else:
  print('LESS')
d,n=map(int,input().split())
if n=100:
    print(pow(100,d)*101)
else:    
    print(pow(100,d)*n)
    

### FIXED CODE ###

d,n=map(int,input().split())
if n==100:
    print(pow(100,d)*101)
else:    
    print(pow(100,d)*n)
a=input()
a[3]=8
print(a)

### FIXED CODE ###

print("2018"+input()[4:])
import re
import sys

s = input()
t = input()

i = 0
dic = {}
length = len(s)
for i in range(0, length-1):
	ss = s[i:i+1]
	tt = t[i:i+1]
	if ss != tt:
		if ss in dic or tt in dic:
			if dic[ss] != tt or dic[tt] != ss:
				print("No")
				sys.exit()
			else:
				it1 = re.finditer(ss, s)
				it2 = re.finditer(tt, s)
				for match in it1:
					s = s[:match.start()] + tt + s[:match.end()]
				for match in it2:
					s = s[:match.start()] + ss + s[:match.end()]
		else:
			dic[ss] = tt
			dic[tt] = ss
			it1 = re.finditer(ss, s)
			it2 = re.finditer(tt, s)
			for match in it1:
				s = s[:match.start()] + tt + s[:match.end()]
			for match in it2:
				s = s[:match.start()] + ss + s[:match.end()]

print("Yes")

### FIXED CODE ###

s = input()
t = input()

start = [-1] * 26
goal = [-1] * 26
flag = True
length = len(s)
dict = { chr(97 + i):i for i in range(26) }
for i in range(0, length):
	a = dict[s[i]]
	b = dict[t[i]]

	if start[a] != -1 or goal[b] != -1:
		if start[a] != b or goal[b] != a:
			flag = False
			break
	else:
		start[a] = b;
		goal[b] = a;
if flag:
	print("Yes")
else:
	print("No")
s=input()
a=int(s[0]);b=int(s[1]);c=int(s[2]);d=int(s[3])
if a+b+c+d==7:
  print(f'{a}+{b}+{c}+{d}=7')
elif a+b+c-d==7:
  print(f'{a}+{b}+{c}-{d}=7')
elif a+b-c+d==7:
  print(f'{a}+{b}-{c}+{d}=7')
elif a-b+c+d==7:
  print(f'{a}-{b}+{c}+{d}=7')
elif a+b-c-d==7:
  print(f'{a}+{b}-{c}-{d}=7')
elif a-b+c-d==7:
  print(f'{a}-{b}+{c}-{d}=7')
elif a-b-c+d==7:
  print(f'{a}-{b}-{c}+{d}=7')
elif a-b-c-d==7:
  print(f'{a}-{b}-{c}-{d}=7')

### FIXED CODE ###

s=input()
a=int(s[0]);b=int(s[1]);c=int(s[2]);d=int(s[3])
if a+b+c+d==7:
  print('{}+{}+{}+{}=7'.format(a,b,c,d))
elif a+b+c-d==7:
  print('{}+{}+{}-{}=7'.format(a,b,c,d))
elif a+b-c+d==7:
  print('{}+{}-{}+{}=7'.format(a,b,c,d))
elif a-b+c+d==7:
  print('{}-{}+{}+{}=7'.format(a,b,c,d))
elif a+b-c-d==7:
  print('{}+{}-{}-{}=7'.format(a,b,c,d))
elif a-b+c-d==7:
  print('{}-{}+{}-{}=7'.format(a,b,c,d))
elif a-b-c+d==7:
  print('{}-{}-{}+{}=7'.format(a,b,c,d))
elif a-b-c-d==7:
  print('{}-{}-{}-{}=7'.format(a,b,c,d))
a,b,n = map(int, input().split(" "))

def floor(x):
    return x//1

dp=[0]*(n+1)

for x in range(1,n+1):
    dp[x] = max(dp[x-1],floor(a*x/b)-a*floor(x/b))

print(int(dp[n]))

### FIXED CODE ###

a,b,n = map(int, input().split(" "))

def floor(x):
    return ((a*x/b)//1) - a*((x/b)//1)

ans = floor(min(b-1,n))

print(int(ans))
h, w = [int(n) for n in input().split()]
i = min(h, w)
j = max(h, w)
area = i * j
if i % 3 == 0 or j % 3 == 0:
    print(0)
else:
    p = j // 3 + 1
    pp = i // 3 + 1
    q = j // 3 - 1
    qq = i // 3 - 1
    a1 = i * p
    aa1 = j * p
    a2 = i * q
    aa2 = j * q
    b1 = i // 2 * (j - p)
    bb1 = j // 2 * (i - p)
    b2 = i // 2 * (j - q)
    bb2 = j // 2 * (i - q)
    c1 = (j - p) // 2 * i
    cc1 = (i - p) // 2 * j
    c2 = (j - q) // 2 * i
    cc2 = (i - q) // 2 * j

    print(min(
        abs(max(a1, b1, area - a1 - b1) - min(a1, b1, area - a1 - b1))
        abs(max(aa1, bb1, area - aa1 - bb1) - min(aa1, b1, area - aa1 - bb1))
        abs(max(aa2, bb2, area - aa2 - bb2) - min(aa2, bb2, area - aa2 - bb2))
        abs(max(a2, b2, area - a2 - b2) - min(a2, b2, area - a2 - b2))
        abs(max(a1, c1, area - a1 - c1) - min(a1, c1, area - a1 - c1))
        abs(max(aa1, cc1, area - aa1 - cc1) - min(aa1, c1, area - aa1 - cc1))
        abs(max(aa2, cc2, area - aa2 - cc2) - min(aa2, cc2, area - aa2 - cc2))
        abs(max(a2, c2, area - a2 - c2) - min(a2, c2, area - a2 - c2))

    ))

### FIXED CODE ###

ipt = input().split()

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
i=int(ipt[0])
j=int(ipt[1])
if i==j:
    print('Yes')
elif i in a and j in a:
    print('Yes')
elif i in b and j in b:
    print('Yes')
else:
    print('No')
N,L = map(str,input().split())

words = list()
for i in range(N):
  words.append(input())
  
words = words.sort()

print(*words,sep ="")


### FIXED CODE ###

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

words = list()
for i in range(N):
  words.append(input())
  
words.sort()

print(*words,sep ="")
x,y,z = input()

D=int x
T=int y
S=int z

if T-D/S>= 0
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

D,T,S = map(int, input().split())

if T-D/S >= 0:
    print("Yes")
else:
    print("No")
S=int(input())
a=s//100
b=s%100
if a>0 and a<=12:
  if b>0 and b<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if b>0 and b<=12:
    print("YYMM")
  else:
    print("NA")

### FIXED CODE ###

s=int(input())
a=s//100
b=s%100
if a>0 and a<=12:
  if b>0 and b<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if b>0 and b<=12:
    print("YYMM")
  else:
    print("NA")
a,b,k=map(int,input().split())
if a=k:
  print('0',b)
  
elif a>k:
  print((a-k),b)
  
else:
  print('0',(b+a-k))
  
  


### FIXED CODE ###

a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
  
else:
  print(0,max(0,a+b-k))
n = int(input())
set_d = set()
for i in range(n):
  d = int(input())
  set_d |= d
print(len(set_d))
  

### FIXED CODE ###

n = int(input())
set_d = set()
for i in range(n):
  d = int(input())
  set_d.add(d)
print(len(set_d))
N, K = map(int, input().split())
x = list(map(int, input().split()))

count_m = 0
count_p = 0
for i in range(N):
    if x[i] > 0:
        count_m = i
        count_p = N-i
        break
    elif x[i] == 0:
        count_m = i
        count_p = N-i-1
        K -= 1
        N -= 1
        x.remove(x[i])
        break
if count_m == 0 and count_p == 0:
    count_m = N

ans = 0
    

y = K
z = K - y
# for j in range(1, y):
#     if count_m-j>0 and count_m+y-1-j<N-1:

#         print(j)

#         print(x[count_m+y-1-j],x[count_m-j] ,x[count_m-1])



if count_m >= 1:

    tmp = min(x[count_m+y-1-j]-x[count_m-j] *2
              for j in range(1, y) if count_m-j>0  and count_m+y-1-j<N-1)
    tmp2 = min(x[count_m+y-1-j]*2-x[count_m-j]
               for j in range(1, y) if count_m-j>0 and count_m+y-1-j<N-1)
else:
    tmp = tmp2 = 1000000000

if count_p>=K:
        # print(y, "1chi")
        ans = min(tmp, tmp2, x[count_m+min(y, count_p)-1])
elif count_m>=K:
        #print("ni")
        ans = min(tmp, tmp2, -x[count_m-K])
else:
        # print("san")
        ans = min(tmp, tmp2)


print(ans)


### FIXED CODE ###

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

count_m = 0
count_p = 0
for i in range(N):
    if x[i] > 0:
        count_m = i
        count_p = N-i
        break
    elif x[i] == 0:
        count_m = i
        count_p = N-i-1
        K -= 1
        N -= 1
        x.remove(x[i])
        break
if count_m == 0 and count_p == 0:
    count_m = N

ans = 0
    

y = K
z = K - y


if count_m >= 1 and count_p>=1:
    # for j in (range(1,y)):
    #     if count_m-j>=0  and count_m+y-1-j<N:
    #         print(x[count_m+y-1-j], x[count_m-j])
    tmp = min(x[count_m+y-1-j]-x[count_m-j] *2 for j in range(1, y) if count_m-j>=0  and count_m+y-1-j<N)
    tmp2 = min(x[count_m+y-1-j]*2-x[count_m-j] for j in range(1, y) if count_m-j>=0 and count_m+y-1-j<N)
else:
    tmp = tmp2 = 1000000000

if N==0:
    ans = 0


elif count_p>=K:
    # print(y, "1chi")
    ans = min(tmp, tmp2, x[count_m+min(y, count_p)-1])
elif count_m>=K:
    #print("ni")
    ans = min(tmp, tmp2, -x[count_m-K])
else:
    #print("san", tmp, tmp2)
    ans = min(tmp, tmp2)


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

for i in range(len(H)-1):
    if H[i] - H[i+1] <= 0:
        ans = "Yes"
    else:
        ans = "No"

print(ans)

### FIXED CODE ###

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

for i in range(N-1):
    if H_max < H[i]:
        H_max = H[i]
    if H[i+1] < H_max - 1:
        print("No")
        break
else:
    print("Yes")
def main():
    s = input()
    for i in range(1<<3):
        t = int(s[0])
        op = []
        for j in range(3):
            if 1 & (i>>j):
                t += int(s[j+1])
                op.append('+')
            else:
                t -= int(s[j+1])
                op.append('-')
        if t == 7:
            x = [f'{a}{b}' for a,b in zip(s, op)]
            print(f'{"".join(x)}{s[-1]}=7')
            break

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    a = input()
    n = 3
    op = ['']*n
    for i in range(1 << n):
        total = int(a[0])
        for j in range(n):
            if 1 & (i >> j):
                total += int(a[j+1])
                op[j] = '+'
            else:
                total -= int(a[j+1])
                op[j] = '-'
        if total == 7:
            break
    ans = a[0]
    for i in range(n):
        ans += op[i]+a[i+1]
    ans += '=7'
    print(ans)

if __name__ == '__main__':
    main()
N=int(input())
H=list(map(int,input().split()))
cnt=1
before=H[0]
for i in range(1,N):
    if before <= H[i]:
        cnt+=1
    before=max(before,H[i])
print(cnt)
            
        

### FIXED CODE ###

A,B=map(int,input().split())
s=0
if A > B:
    s=A+(A-1)
elif A < B:
    s=B+(B-1)
else:
    s=A+B
print(s)
N = map(int, input().split())
if (N % 10 == 3):
	print("bon")
elif (N % 10 ==0 or N % 10 ==1 or N % 10 ==6 or N % 10 ==8):
	print("pon")
else:
	print("hon)


### FIXED CODE ###

N = int(input())
if (N % 10 == 3):
	print("bon")
elif (N % 10 ==0 or N % 10 ==1 or N % 10 ==6 or N % 10 ==8):
	print("pon")
else:
	print("hon")
lst = map(int, input().split())
r = lst[0]
g = lst[1]
print(2*g-r)


### FIXED CODE ###

r=int(input())
g=int(input())
print(2*g-r)