
n, k = map(int, input().split())

if k <= 1:
    ans = 0
else:
    nokori = n - k
    ans = nokori

print(ans) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k if k <= 1:
    ans = 0
else:
    nokori = n - k
    ans = nokori k <= 1 k 1 ans = 0 ans 0 nokori = n - k nokori n - k n k ans = nokori ans nokori print(ans) print ans nokori = n - k n - k nokori ans = 0 0 ans ans = nokori nokori ans k = map(int, input().split()) map(int, input().split()) k n, k = map(int, input().split()) map(int, input().split()) n

n, k = map(int, input().split())

if k <= 1:
    ans = 0
else:
    nokori = n - k
    ans = nokori

print(ans)