A, B = list(map(int, input().split())) if A < B: count = (A - 1) + (B - (A + 1)) else: count = 2000000000 - 2 print(count)