a , b = input().split()
if int(b)==1:
    print(0)
else:
    print(int(a)-int(b)) a , b = input().split() a input().split() ().split () input split b if int(b)==1:
    print(0)
else:
    print(int(a)-int(b)) int(b)==1 int(b) int b 1 print(0) print 0 print(int(a)-int(b)) print int(a)-int(b) int(a) int a int(b) int b a , b = input().split() input().split() a b = input().split() input().split() b
a , b = input().split()
if int(b)==1:
    print(0)
else:
    print(int(a)-int(b))