n,k = (int(i) for i in input().split())
if k-1: print(n-k)
else: print(0) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i n,k = (int(i) for i in input().split()) n (int(i) for i in input().split()) k if k-1: print(n-k)
else: print(0) k-1 k 1 n,k = (int(i) for i in input().split()) (int(i) for i in input().split()) n k = (int(i) for i in input().split()) (int(i) for i in input().split()) k
n,k = (int(i) for i in input().split())
if k-1: print(n-k)
else: print(0)