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