balls, men = map(int,input().split())

if men == 1:
  print(0)
else:
  print(balls - men) balls, men = map(int,input().split()) balls map(int,input().split()) map int input().split() ().split () input split men if men == 1:
  print(0)
else:
  print(balls - men) men == 1 men 1 print(0) print 0 print(balls - men) print balls - men balls men men = map(int,input().split()) map(int,input().split()) men balls, men = map(int,input().split()) map(int,input().split()) balls
balls, men = map(int,input().split())

if men == 1:
  print(0)
else:
  print(balls - men)