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

f0fe9d534e7bac170675884478ecfcc2d178bd32
<mask token>

<mask token>
if a[1] == 1:
    print(0)
else:
    print(a[0] - a[1])

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