n, k = map(int, input().split())
must = k
rest = n - must
if k == 1:
    print(0)
else:
    print(rest) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k must = k must k rest = n - must rest n - must n must if k == 1:
    print(0)
else:
    print(rest) k == 1 k 1 print(0) print 0 print(rest) print rest n, k = map(int, input().split()) map(int, input().split()) n rest = n - must n - must rest k = map(int, input().split()) map(int, input().split()) k must = k k must
n, k = map(int, input().split())
must = k
rest = n - must
if k == 1:
    print(0)
else:
    print(rest)
