a,b = map(int,input().split())
x = []
for i in range(b):
    x.append(1)
    a = a - 1
for i in range(a):
    x[0] = x[0] + 1
x.sort()
print(abs(x[0] - x[len(x) - 1])) a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b x = [] x [] for i in range(b):
    x.append(1)
    a = a - 1 i range(b) range b x.append(1) x.append x append 1 a = a - 1 a a - 1 a 1 for i in range(a):
    x[0] = x[0] + 1 i range(a) range a x[0] = x[0] + 1 x[0] x 0 x[0] + 1 x[0] x 0 1 x.sort() x.sort x sort print(abs(x[0] - x[len(x) - 1])) print abs(x[0] - x[len(x) - 1]) abs x[0] - x[len(x) - 1] x[0] x 0 x[len(x) - 1] x len(x) - 1 len(x) len x 1 a = a - 1 a - 1 a b = map(int,input().split()) map(int,input().split()) b x = [] [] x a,b = map(int,input().split()) map(int,input().split()) a
a,b = map(int,input().split())
x = []
for i in range(b):
    x.append(1)
    a = a - 1
for i in range(a):
    x[0] = x[0] + 1
x.sort()
print(abs(x[0] - x[len(x) - 1]))