a = [int(i) for i in input().split()]
if a[1] == 1:
  print(0)
else:
  print(a[0]-a[1]) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a = [int(i) for i in input().split()] a [int(i) for i in input().split()] if a[1] == 1:
  print(0)
else:
  print(a[0]-a[1]) a[1] == 1 a[1] a 1 1 print(0) print 0 print(a[0]-a[1]) print a[0]-a[1] a[0] a 0 a[1] a 1 a = [int(i) for i in input().split()] [int(i) for i in input().split()] a
a = [int(i) for i in input().split()]
if a[1] == 1:
  print(0)
else:
  print(a[0]-a[1])