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