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 ans = n-k if k > 1 else 0 n-k if k > 1 else 0 ans n, k = map(int, input().split()) map(int, input().split()) n
n, k = map(int, input().split())
ans = n-k if k > 1 else 0
print(ans)