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