N,K = list(map(int,input().split())) if N > K: print(N - K + 2) elif N == K: print(1) else: print(0)