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

count=0



while N>=i:

    count+=1

    N-=1





print(count)
n,i=list(map(int,input().split()))

j=0

for v in range(n):

    j=j+1

    if (n-1)>= i:

        

        n=n-1



    else:    

        break

 

print (j)

N, i = list(map(int, input().split()))
count = 0
while N >= i:
    count += 1
    N -= 1
print(count)

n, i = list(map(int, input().split()))
j = 0
for v in range(n):
    j = j + 1
    if (n - 1) >= i:
        n = n - 1
    else:
        break
print(j)

-N, i = list(map(int, input().split())) -count = 0 -while N >= i: -    count += 1 -    N -= 1 -print(count) +n, i = list(map(int, input().split())) +j = 0 +for v in range(n): +    j = j + 1 +    if (n - 1) >= i: +        n = n - 1 +    else: +        break +print(j)