def kad_test(): ary = range(2000000000+1) a,b = input().split(' ') a = int(a) b = int(b) flag=False if a>b: a,b = b,a flag = True l = [] if a == 1 else ary[1:a] m = [] if (b - a) == 1 else ary[(a+1):b] r = ary[(b+1):] #print(l) #print(m) #print(r) if not flag: print(len(l) + len(m)) else: print(len(m) + len(r)) kad_test()