N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

ans = max(0, N-K)

if K==1: ans=0

print(ans) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K ans = max(0, N-K) ans max(0, N-K) max 0 N-K N K if K==1: ans=0 K==1 K 1 print(ans) print ans N, K = map(int, input().split()) map(int, input().split()) N K = map(int, input().split()) map(int, input().split()) K ans = max(0, N-K) max(0, N-K) ans
N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

ans = max(0, N-K)

if K==1: ans=0

print(ans)
