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