(N, K) = list(map(int, input().split()))
max_distribution = N - K
if K == 1:
    max_distribution = 0
print(max_distribution) (N, K) = list(map(int, input().split())) (N, K) N K list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split max_distribution = N - K max_distribution N - K N K if K == 1:
    max_distribution = 0 K == 1 K 1 max_distribution = 0 max_distribution 0 print(max_distribution) print max_distribution max_distribution = N - K N - K max_distribution max_distribution = 0 0 max_distribution
(N, K) = list(map(int, input().split()))
max_distribution = N - K
if K == 1:
    max_distribution = 0
print(max_distribution)
