#!/usr/bin/env python3

n, k = [int(x) for x in input().split()]
print(n - k if k != 1 else 0) int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x n, k = [int(x) for x in input().split()] n [int(x) for x in input().split()] k print(n - k if k != 1 else 0) print n - k if k != 1 else 0 k != 1 k 1 n - k n k 0 n, k = [int(x) for x in input().split()] [int(x) for x in input().split()] n k = [int(x) for x in input().split()] [int(x) for x in input().split()] k
#!/usr/bin/env python3

n, k = [int(x) for x in input().split()]
print(n - k if k != 1 else 0)
