Harryxun/stf_run huggingface dataset:
N,C = list(map(int,input().split()))

x = [None]*N
rev_x = [None]*N
v = [None]*N

T = [None]*N
Trev = [None]*N

Tall = []

for i in range(N):
    a,b = list(map(int,input().split()))
    x.append(a)
    rev_x.append(C - a)
    v.append(b)

rev_x.reverse()

for i in range(N):
    T.append(sum(v[0:i+1]) - x[i])

v.reverse()

for i in range(N):
    Trev.append(sum(v[0:i+1]) - rev_x[i])

Tall = T + Trev

for i in range(N):
    for j in range(N - i - 1):
        Tall.append(T[i] + Trev[j] - min(x[i], rev_x[j]))

Tmax = max(Tall)
if Tmax < 0:
    Tmax = 0
print(Tmax)



### FIXED CODE ###

S = input()
S = S.replace('x','')
len_S =len(S)
print(len_S * 100 + 700)
a, b, c = map(int, input().split)
if a <= c <= b:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a, b, c = map(int, input().split())
if a <= c <= b:
    print("Yes")
else:
    print("No")
a,b,t = map(int, input().split())
print(b*((t+0.5)//a)

### FIXED CODE ###

a,b,t = map(int, input().split())
print(b* int((t+0.5)//a) )
N,M=map(int,input().split())
mod=10**9+7

#x以下の素数の列挙   
import math
x=math.floor(math.sqrt(10**9))
L=math.floor(math.sqrt(x))#平方根を求める
Primelist=[i for i in range(x+1)]
Primelist[1]=0#素数でないものは0にする.
for i in Primelist:
    if i>L:
        break
    if i==0:
        continue
    for j in range(2*i,x+1,i):
        Primelist[j]=0
Primes=[Primelist[j] for j in range(x+1) if Primelist[j]!=0]

#素因数分解
LISTS=[0 for i in range(4000)]
i=0
while M!=1:
    if M%Primes[i]==0:
        LISTS[i]+=1
        M=M//Primes[i]
    else:
        i+=1

def Combi2(a,b):#aは大きいが、bは小さいとき
    ANS=1
    for i in range(min(b,a-b)):
        ANS=ANS*(a-i)*pow(b-i,mod-2,mod)

    return ANS%mod


ANS=1
for i in range(len(LISTS)):
    if LISTS[i]>=1:
        ANS=ANS*Combi2(N-1+LISTS[i],LISTS[i])%mod

print(ANS)


### FIXED CODE ###

N,M=map(int,input().split())
mod=10**9+7

#x以下の素数の列挙   
import math
x=math.floor(math.sqrt(10**9))
L=math.floor(math.sqrt(x))#平方根を求める
Primelist=[i for i in range(x+1)]
Primelist[1]=0#素数でないものは0にする.
for i in Primelist:
    if i>L:
        break
    if i==0:
        continue
    for j in range(2*i,x+1,i):
        Primelist[j]=0
Primes=[Primelist[j] for j in range(x+1) if Primelist[j]!=0]

#素因数分解
DICT=dict()
i=0
while M!=1:
    if M%Primes[i]==0:
        DICT[i]=DICT.get(i,0)+1
        M=M//Primes[i]
    elif i<len(Primes)-1:
        i+=1
    else:
        DICT[M]=1
        M=1

def Combi2(a,b):#aは大きいが、bは小さいとき
    ANS=1
    for i in range(min(b,a-b)):
        ANS=ANS*(a-i)%mod*pow(b-i,mod-2,mod)%mod

    return ANS%mod


ANS=1
for i in DICT.values():
    ANS=ANS*Combi2(N-1+i,i)%mod

print(ANS)
n = int(input())

for i in range(1, 9)
	for j in range(1, 9)
    	if n == i * j:
        	print("Yes")
            exit

print("No")

### FIXED CODE ###

n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)
T = list(map(str, input()))
count = 0
ans = []

if T[0] == '?':
    T.pop(0)
    if T[1] == 'D' or T[1] == '?':
        ans.append('P')
        T.insert(0, 'P')
    else:
        ans.append('D')
        T.insert(0, 'D')
else:
    ans.append(T[0])

for i in range(1, len(T)):
    if T[i] == '?':
        if ans[i - 1] == 'D':
            if len(T) % 2 == 0:
                ans.append('P')
            else:
                ans.append('D')
        else:
            ans.append('D')
    else:
        ans.append(T[i])


for i in range (0, len(ans) - 1):
    if ans[i] == 'P' and ans[i + 1] == 'D':
        count += 1
    if ans[i] == 'D':
        count += 1
if ans[len(ans) - 1] == 'D':
    count += 1



print(str(count))


### FIXED CODE ###

T = list(map(str, input()))
count = 0
ans = []




for i in range(0, len(T)):
    if T[i] == '?':
        ans.append('D')
    else:
        ans.append(T[i])


ans_ans = ''.join(ans);

print(ans_ans)
import copy

def cape(iri):
    ima = set()
    for i in iri:
        for j in root[i]:
#            print(i, j)
            if ans[j] == 0:
                ans[j] = i
                root[j] -= {i}
                ima = ima | {j}
    if ima != set():
        cape(ima)

N, M = map(int, input().split())
root = [set() for i in range(N + 1)]
ans = [0 for i in range(N + 1)]
for i in range(M):
    a, b = map(int, input().split())
    root[a].add(b)
    root[b].add(a)
#print(root)
cape({1})
#print(ans)
print("Yes")
for i in range(2, N + 1):
    print(ans[i])

### FIXED CODE ###

from collections import deque
N, M = map(int, input().split())
root = [set() for i in range(N + 1)]
ans = [0 for i in range(N + 1)]
for i in range(M):
    a, b = map(int, input().split())
    root[a].add(b)
    root[b].add(a)
task = deque([1])
itta = {1}
while len(task) > 0:
    now = task.popleft()
    additional = root[now] - itta
    for i in additional:
        ans[i] = now
        itta.add(i)
    task.extend(list(additional))
print("Yes")
for i in range(2, N + 1):
    print(ans[i])
N,M,K=map(int,input().split())
A=[]
B=[]
A=list(map(int,input().split()))
B=list(map(int,input().split()))

dp=[[0 for j in range(K)] for i in range(max(N,M))]
if(N<M):
    ma=M
    mi=N
    turn='M'
else:
    ma=N
    mi=M
    turn='N'

if(turn='M')
    for i in range(nn):
        for j in range(K+1):
            if(mi<i):
                if(B[i]<j):
                    dp[i+1][j]=max(dp[i][j-B[i]]+1,dp[i][j])
                else:
                    dp[i+1][j]=dp[i][j]
            else:
                if(A[i]<j and B[i]<j):
                    dp[i+1][j]=max(dp[i][j-A[i]-B[i]]+2,dp[i][j])

                elif(A[i]<j):
                    dp[i+1][j]=max(dp[i][j-A[i]+1,dp[i][j]])
                elif(B[i]<j):
                    dp[i+1][j]=max(dp[i][j-B[i]]+1,dp[i][j])
                else:
                    dp[i+1][j]=dp[i][j]
else:
    for i in range(nn):
        for j in range(K+1):
            if(mi<i):
                if(A[i]<j):
                    dp[i+1][j]=max(dp[i][j-A[i]]+1,dp[i][j])
                else:
                    dp[i+1][j]=dp[i][j]
            else:
                if(A[i]<j and B[i]<j):
                    dp[i+1][j]=max(dp[i][j-A[i]-B[i]]+2,dp[i][j])

                elif(A[i]<j):
                    dp[i+1][j]=max(dp[i][j-A[i]+1,dp[i][j]])
                elif(B[i]<j):
                    dp[i+1][j]=max(dp[i][j-B[i]]+1,dp[i][j])
                else:
                    dp[i+1][j]=dp[i][j]

print(dp[nn][K])


### FIXED CODE ###

N,M,K=map(int,input().split())
A=[]
B=[]
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a=[0 for i in range(len(A)+1)]
for i in range(1,len(A)+1):
    a[i]=a[i-1]+A[i-1]

b=[0 for i in range(len(B)+1)]
for i in range(1,len(B)+1):
    b[i]=b[i-1]+B[i-1]

j=M
ans=0
for i in range(len(A)+1):

    if(K<a[i]):
        break
    #print(a[i]+b[j])
    while(a[i]+b[j]>K):
        j=j-1
    ans=max(ans,i+j)

print(ans)
import math
N=int(input())
a = input().split()
a_num= [int(s) for s in a]

count=0
while True:
    for i in range(len(a_num)):
        a_num[i]=math.floor(a_num[i]/2)  
    count +=1
    if a_num[i]%2 != 0:
        break
print(count-1)

### FIXED CODE ###

s=list(input())
s_int=[int(n) for n in s]
ans=0
for i in range(3):
    if s_int[i]==1:
        ans=ans+1
print(ans)
A, B = map(int, input().split())
while B != 0:
  A, B = B, A % B
i, j = 0, 1
L = []
for k in range(2, A // 2 + 1):
  z = 0
  for i in range(len(L)):
    if k % L[i] == 0:
      z += 1
      break
  if z == 0:
    L.append(k)
while i <= len(L) and A != 1:
  if A % L[i] == 0:
    j += 1
    while A % L[i] == 0:
      A //= L[i]
  i += 1
print(j)

### FIXED CODE ###

A, B = map(int, input().split())
a, b = A, B
while b != 0:
  a, b = b, a % b
prod = 1
s = 1
p = 2
g = a
while a != 1:
  i = 0
  while a % p == 0:
    i += 1
    a //= p
    prod *= p
  if i != 0:
    s += 1
  p += 1
  if p > int(g**(1/2)) and prod != g:
    s += 1
    break
print(s)
import math as mt
N = int(input())

if N % 2 == 1 and N == 0:
    print(0)
    exit()

r = 0
L = int(mt.log(N,5))
for i in range(1,L+1):
    p = N//(5**i)//2
    r += p
    #print(N,5**i,p)
print(r)

### FIXED CODE ###

import math as mt
N = int(input())

if N % 2 == 1 or N < 2:
    print(0)
    exit()

r = 0
L = int(mt.log(N,5))
for i in range(1,L+1):
    p = N//(5**i)//2
    r += p
    #print(N,5**i,p)
print(r)
N = int(input())
nums = list(map(iunt, input().split()))
upper = True
lower = True
before = nums[0]
answer = 0
for i, num in enumerate(nums):
  if before < num:
    lower = False
  elif before > num:
    upper = False
  before = num
  if not upper and not lower:
    answer += 1
    upper = True
    lower = True
print(answer+1)

### FIXED CODE ###

N = int(input())
nums = list(map(int, input().split()))
upper = True
lower = True
before = nums[0]
answer = 0
for i, num in enumerate(nums):
  if before < num:
    lower = False
  elif before > num:
    upper = False
  before = num
  if not upper and not lower:
    answer += 1
    upper = True
    lower = True
print(answer+1)
S=str(input())
if S="ABC":
    print("ARC")
elif S="ARC":
    print("ABC")


### FIXED CODE ###

S=str(input())
if S=="ABC":
    print("ARC")
elif S=="ARC":
    print("ABC")
a = list(input())
b = a[::2].index('0') + a[1::2].index('1')
c = min(b, len(a) - b)
print(c)


### FIXED CODE ###

a = list(input())
b = a[::2].count('0') + a[1::2].count('1')
c = min(b, len(a) - b)
print(c)
import sys


scan = sys.stdin.readline


def main():
  n, m = map(int, scan().rstrip().split())
  l = 0
  r = n
  
  for _ in range(m):
    l_i, r_i = map(int, scan().rstrip().split())
    l = max(l, l_i)
    r = min(r, r_i)
    
  cards = r - l + 1 if r > l else 0
  
  print(cards)
  

if __name__ = "__main__":
  main()


### FIXED CODE ###

import sys


scan = sys.stdin.readline


def main():
  n, m = map(int, scan().rstrip().split())
  l = 0
  r = n
  
  for _ in range(m):
    l_i, r_i = map(int, scan().rstrip().split())
    l = max(l, l_i)
    r = min(r, r_i)
    
  cards = r - l + 1 if r >= l else 0
  
  print(cards)
  

if __name__ == "__main__":
  main()
A, B = map(int, input().split())
if A == B:
	print('Draw')
elif A == 1:
	pirnt('Alice')
elif B == 1:
	print('Bob')
elif A > B:
	print('Alice')
else:
	print('Bob')          


### FIXED CODE ###

A, B = map(int, input().split())
if A == B:
	print('Draw')
elif A == 1:
	print('Alice')
elif B == 1:
	print('Bob')
elif A > B:
	print('Alice')
else:
	print('Bob')
N=int(input())
A=[int(i) for i in input().split()]
T=[[A[0],A[1]]]
k=0
for i in range(2,N):
    if len(T[k])<=1:
        T[k].append(A[i])
        continue
    if not(A[i-2]>=A[i-1]>=A[i] or A[i-2]<=A[i-1]<=A[i]):
        k+=1
        T.append([])
        T[k].append(A[i])
    else:
        T[k].append(A[i])
print(len(T))


### FIXED CODE ###

N=int(input())
A=[int(i) for i in input().split()]
if N==1:
    print(1)
    exit()
T=[[A[0],A[1]]]
k=0
for i in range(2,N):
    if len(T[k])<=1:
        T[k].append(A[i])
        continue
    if not((T[k][0]>=A[i-2]>=A[i-1]>=A[i]) or (T[k][0]<=A[i-2]<=A[i-1]<=A[i])):
        k+=1
        T.append([A[i]])
    else:
        T[k].append(A[i])
print(len(T))
from scipy.sparse.csgraph import shortest_path
import sys
import numpy as np
def input():
    return sys.stdin.readline().strip()
 
N = int(input())
 
graph = [[0 for i in range(N)] for j in range(N)]
 
for i in range(N-1):
    a,b,c = map(int,input().split())
    graph[a-1][b-1] = c
    graph[b-1][a-1] = c

Q,K = map(int,input().split())
dist = shortest_path(np.array(graph),indices=K-1)

for i in range(Q):
    x,y = map(int,input().split())
    print(int(dist[x-1]+dist[y-1]))

### FIXED CODE ###

import heapq

"""
https://juppy.hatenablog.com/entry/2019/02/18/%E8%9F%BB%E6%9C%AC_python_%E3%83%97%E3%83%A9%E3%82%A4%E3%82%AA%E3%83%AA%E3%83%86%E3%82%A3%E3%82%AD%E3%83%A5%E3%83%BC%28heapq%29%E3%82%92%E7%94%A8%E3%81%84%E3%81%9F%E3%83%97%E3%83%AA%E3%83%A0%E6%B3%95
"""

def dijkstra_heap(s,edge):
    #始点sから各頂点への最短距離
    d = [10**10]*n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d
 
################################
N = int(input())
n = N
w = N
 
edge = tuple([] for i in range(n))
#edge[i] : iから出る道の[重み,行先]の配列
for i in range(w-1):
    a,b,c = map(int,input().split())
    edge[a-1].append([c,b-1])
    edge[b-1].append([c,a-1])


Q,K = map(int,input().split())
dist = dijkstra_heap(K-1,edge)
 
for i in range(Q):
    x,y = map(int,input().split())
    print(int(dist[x-1]+dist[y-1]))
N,R=int(input().split())
c=0
if N>=10:
  c=R
else:
  c=R+100*(10-c)
print(c)

### FIXED CODE ###

N,R=map(int,input().split())
c=0
if N>=10:
  c=R
else:
  c=R+100*(10-N)
print(c)
a,b,c,d = map(int,input().split())

if a+ b < c + d:
  print('Left')
elif a + b = c + d:
  print('Balanced')
else:
  print('Right')

### FIXED CODE ###

a,b,c,d = map(int,input().split())
 
if a+ b > c + d:
  print('Left')
elif a + b == c + d:
  print('Balanced')
else:
  print('Right')
from math import gcd

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

def not_devision(a, x, y):
    return (a - (a//x)) + (a - (a//y)) - (a - (a//((x*y)//gcd(x, y))))

print(not_devision(b, c, d) - not_devision(a-1, c, d))

### FIXED CODE ###

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

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

def lcm(a, b):
    return a*b//gcd(a, b)

x = (b - (b//c)) + (b - (b//d)) - (b - (b//lcm(c, d)))
y = (a-1 - ((a-1)//c)) + (a-1 - ((a-1)//d)) - (a-1 - ((a-1)//lcm(c, d)))

print(x-y)
import math
mod = 10**9+7
def mod_combination(n, k, mod):
    # nCk (mod m)
    def mod_permutation(n, k, mod):
        if n<=k:
            return 1
        else:
            return (n * mod_permutation(n-1,k,mod))%mod

    def mod_inv_permutation(k, mod):
        k, mod = int(k), int(mod)
        if k<=1:
            return 1
        else:
            return (pow(k,mod-2,mod) * mod_inv_permutation(k-1, mod))%mod

    return (mod_permutation(n,n-k,mod) * mod_inv_permutation(k, mod))%mod


X,Y = map(int,input().split())
s = (2*Y-X)//3
t = (2*X-Y)//3

if (X+Y)%3 == 0 :
    ans =  mod_combination(s+t, s, mod)
    print(ans)
else:
    print(0)
    

### FIXED CODE ###

def combination(n, k, p):
    numerator = 1
    for i in range(k):
        numerator = (numerator * (n-i)) % p
 
    denominator = 1
    for i in range(1, k+1):
        denominator = (denominator * i) % p
 
    return (numerator * pow(denominator, p-2, p)) % p
 
 
X, Y = map(int, input().split())
 
a = (2*Y-X) / 3
b = (2*X-Y) / 3
 
if a >= 0 and b >= 0 and a == int(a) and b == int(b):
    a = int(a)
    b = int(b)
 
    print(combination(a+b, a, 10**9+7))
else:
    print(0)
n = int(input())
a = [[] for _ in range(n)]
for i in range(n):
  num = int(input())
  for j in range(num):
    person, state = map(int, input().split())
    a[i].append([person-1, state])
honest = 0
for i in range(1, 2**n):
  flag = True
  for j in range(n):
    if (i>>j)&1 == 1:
      for x, y in a[j]:
        if (i>>x)&1 != y:
          flag = False
          break
  if flag:
    honest = max(honest, bin(i)[2:].count('1'))
print(honest)


### FIXED CODE ###

a, b, c = map(int, input().split())
print('win' if a+b+c<=21 else 'bust')
from numba import njit


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


@njit('(i8[::1],)', cache=True)
def query(lamps):
    counts = [0] * n
    for idx, power in enumerate(lamps):
        start, end = idx - power, idx + power
        if start < 0:
            start = 0
        counts[start] += 1

        if end >= n-1:
            continue
        counts[end+1] -= 1

    now = 0
    for idx, count in enumerate(counts):
        now += count
        lamps[idx] = now


def full_check(counts, full):
    for count in counts:
        if count == full:
            continue
        else:
            return False

    return True


for _ in range(k):
    query(A)
    if full_check(A, n):
        break

print(*A)


### FIXED CODE ###

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


def query(lamps):
    start_list = []
    end_list = []
    for idx, power in enumerate(lamps):
        start, end = idx - power, idx + power
        start_list.append(start)
        end_list.append(end)

    start_list.sort(reverse=True)
    end_list.sort(reverse=True)

    now = 0
    for idx in range(n):
        while start_list and start_list[-1] <= idx:
            start_list.pop()
            now += 1

        while end_list and end_list[-1] < idx:
            end_list.pop()
            now -= 1

        lamps[idx] = now


def full_check(counts, full):
    for count in counts:
        if count == full:
            continue
        else:
            return False

    return True


for _ in range(k):
    query(A)
    if full_check(A, n):
        break

print(*A)
n,m=map(int,input().split())
lst=[int(input()) for i in range(m)]
DP=[0]*(n+1)
temp=0
DP[0]=1
for i in range(1, n+1):
  if i==1 and not in lst:
    DP[i]=1
  elif i in lst:
    DP[i]=0
  else:
    DP[i]=DP[i-1]+DP[i-2]
print(DP[n]%1000000007)

### FIXED CODE ###

N,M=map(int,input().split())
br=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
if not 1 in br:
    dp[1]=1
for i in range(2,N+1):
    if not i in br:
        dp[i]+=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])
a, b = int(input().split())
print(a + b) if a + b  < 10 else print("error")

### FIXED CODE ###

a, b = map(int, input().split())
print(a + b) if (a + b) < 10 else print("error")
N,A,B=map(int, input().split())
a=[]

for i in range(N+1):
    j=i
    n=0
    while True:
        n+=i%10
        if i//10==0:
            break
        else:
            i=i//10
    if A<=n<=B:
        a.append(j)
    else:
        pass
print(sum(a))
        

### FIXED CODE ###

X=int(input())
A=int(input())
B=int(input())

X=X-A

while True:
    X=X-B
    if X-B<0:
        break
    else:
        pass
print(X)
X,Y = map(int,input().split())
if X<Y:
    print("<")
elif X>Y:
    print(">")
else:
    print("=")

### FIXED CODE ###

X,Y = input().split()
X = int("0x"+X,0)
Y = int("0x"+Y,0)

if X<Y:
    print("<")
elif X>Y:
    print(">")
else:
    print("=")
k = int(input())
s = input()
mod = 10**9+7

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

modp = mod
max_n = 10 ** 6+2  # 必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod modp)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod modp)
inv = [0, 1]  # factinv 計算用

for i in range(2, max_n + 1):
    fact.append((fact[-1] * i) % modp)
    inv.append((-inv[modp % i] * (modp // i)) % modp)
    factinv.append((factinv[-1] * inv[-1]) % modp)

ans = 0
for i in range(k+1):
    now = pow(26, k-i, mod)
    now = (now * pow(25, i, mod))%mod
    now = (now * cmb(i+len(s)-1, len(s)-1, mod))%mod
    ans += now
print(ans%mod)

### FIXED CODE ###

k = int(input())
s = input()
mod = 10**9+7

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

modp = mod
max_n = k + len(s)+1 # 必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod modp)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod modp)
inv = [0, 1]  # factinv 計算用

for i in range(2, max_n + 1):
    fact.append((fact[-1] * i) % modp)
    inv.append((-inv[modp % i] * (modp // i)) % modp)
    factinv.append((factinv[-1] * inv[-1]) % modp)

ans = 0
for i in range(k+1):
    now = pow(26, k-i, mod)
    now = (now * pow(25, i, mod))%mod
    now = (now * cmb(i+len(s)-1, len(s)-1, mod))%mod
    ans += now
print(ans%mod)
from collections import Counter
import math
N = int(input())
A = list(map(int,input().split()))
R = []
T = []
C = Counter(A)
cnt = 0
for c in C.items():
  if c[1] > 1:
    cnt += c[1] - 1
    T.append(c[0])
  else:
    R.append(c[0])
Max_R = max(T)
Min_R = min(T)
flg = False
for r in R:
  if Min_R <= r <= Max_R:
    flg = True
    break
if cnt % 2 != 0:
  ans = N - cnt - 1
else:
  if flg:
    ans = N - cnt
  else:
    ans = N - cnt - 2
print(ans)

### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int,input().split()))
C = Counter(A)
L = len(C)
print(L-1 if L % 2 == 0 else L)
n=int(input())
if n==1:
  print(0)
if n==2:
  print(1)
else:
  ans=1
  for i in range(3,n+1):
    ans+=(i-1)
print(ans)

### FIXED CODE ###

n=int(input())
if n==1:
  print(0)
else:
  print(n*(n-1)//2)
a,b=map(int,inout().split())
if a <= b:
  print(a)
else:
  print(a-1)

### FIXED CODE ###

a,b=map(int,input().split())
if a <= b:
  print(a)
else:
  print(a-1)
if (S[0] == S[1] == S[2]) or (S[1] == S[2] == S[3]) or (S[0] == S[1] == S[2] == S[3] == S[4]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input()

if (S[0] == S[1] == S[2]) or (S[1] == S[2] == S[3]):
    print("Yes")
else:
    print("No")
from operator import itemgetter
n,m = map(int,input().split())
t = [list(map(int,input().split())) for _ in range(m)]
t.sort(key=itemgetter(0))
c = [i[1] for i in t ]
s = [i[0] for i in t]
# print(c)
x = 0
ans = "aaa"
ans = list(ans)
for i in range(3):
    for j in range(len(s)):
        if i==s[j]-1 :
            if str(c[j])!=ans[i] and ans[i]=="a":
                ans[i]=str(c[j])
            elif  str(c[j])!=ans[i] and ans[i]!="a":
                x =1
# print(ans)

if x==1:
    print(-1)
elif n!=1 and ans[3-n]=="0":
    print(-1)
else:
    if ans[3-n]=="a" and max(s)<4-n and n!=1:
        ans[3-n]="1"
    for i in range(3):
        if ans[i]=="a":
            ans[i]="0"
    # if ans[n-1]=="0" and max(s)<n and n!=1:
    #     ans[n-1]="1"
    # print(ans)
    ans = int("".join(ans))

    print(ans)

### FIXED CODE ###

from operator import itemgetter
n,m = map(int,input().split())
t = [list(map(int,input().split())) for _ in range(m)]
t.sort(key=itemgetter(0))
c = [i[1] for i in t ]
s = [i[0] for i in t]
# print(c)
x = 0

ans = "a"*n
ans = list(ans)
for i in range(n):
    for j in range(len(s)):
        if i==s[j]-1 :
            if str(c[j])!=ans[i] and ans[i]=="a":
                ans[i]=str(c[j])
            elif  str(c[j])!=ans[i] and ans[i]!="a":
                x =1
# print(ans)

if ans[0]=="0" and n!=1:
    x=1
for i in range(len(ans)):
    if ans[i]=="a":
        ans[i]="0"
# print(ans)
if ans[0]=="0"and n!=1:
    ans[0]="1"
if x==0:
    print(int("".join(ans)))
else:
    print(-1)
a, b, k = int(input().split())
for i in reversed(range(min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k--
  if k is 0:
    print(i)
    exit()

### FIXED CODE ###

a, b, k = map(int, input().split())
for i in reversed(range(1, min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k -= 1
  if k is 0:
    print(i)
    exit()
N,K = map(int,input().split())
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
l = len(ROOP)

num = (K-l-roopstart) % (l)
print(ROOP[num])

### FIXED CODE ###

S = input()
T = input()
flag =0
for i in range(len(S)):
    if S[i] != T[i]:
        flag=1

if flag ==1:
    print("No")
else:
    print("Yes")
a, b = map(int, input().split())
if (a%2==0 or b%2==0):
  print("Even")
else :
  print("Odd)

### FIXED CODE ###

a,b = map(int, input().split())
if (a%2==0 or b%2==0):
  print("Even")
else:
  print("Odd")