a=[]
for x in input().split(" "):
    a.append(int(x))

if a[1]==1:
    print(0)
else:
    print(a[0]-a[1]) a=[] a [] for x in input().split(" "):
    a.append(int(x)) x input().split(" ") ().split () input split " " a.append(int(x)) a.append a append int(x) int x 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=[] [] a
a=[]
for x in input().split(" "):
    a.append(int(x))

if a[1]==1:
    print(0)
else:
    print(a[0]-a[1])