N,K= [int(i) for i in input().split()]
print(N-K if K!=1 else 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 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 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()] [int(i) for i in input().split()] N
N,K= [int(i) for i in input().split()]
print(N-K if K!=1 else 0 )