x=list(map(int, input().split()))
if x[1]==1:
	print(0)
else:
	print(x[0]-x[1]) x=list(map(int, input().split())) x list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split if x[1]==1:
	print(0)
else:
	print(x[0]-x[1]) x[1]==1 x[1] x 1 1 print(0) print 0 print(x[0]-x[1]) print x[0]-x[1] x[0] x 0 x[1] x 1 x=list(map(int, input().split())) list(map(int, input().split())) x
x=list(map(int, input().split()))
if x[1]==1:
	print(0)
else:
	print(x[0]-x[1])