N, K = map(int, input().split())
a = N//K
b = N-K
if K == 1:
    print(0)
else:
    print(b-a+1) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K a = N//K a N//K N K b = N-K b N-K N K if K == 1:
    print(0)
else:
    print(b-a+1) K == 1 K 1 print(0) print 0 print(b-a+1) print b-a+1 b-a b a 1 a = N//K N//K a K = map(int, input().split()) map(int, input().split()) K N, K = map(int, input().split()) map(int, input().split()) N b = N-K N-K b
N, K = map(int, input().split())
a = N//K
b = N-K
if K == 1:
    print(0)
else:
    print(b-a+1)
