
N, K = map(int, input().split())
if K == 1:
    print('{}'.format(0))
else:
    print('{}'.format(N-K)) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K if K == 1:
    print('{}'.format(0))
else:
    print('{}'.format(N-K)) K == 1 K 1 print('{}'.format(0)) print '{}'.format(0) '{}'.format '{}' format 0 print('{}'.format(N-K)) print '{}'.format(N-K) '{}'.format '{}' format N-K N K K = map(int, input().split()) map(int, input().split()) K N, K = map(int, input().split()) map(int, input().split()) N

N, K = map(int, input().split())
if K == 1:
    print('{}'.format(0))
else:
    print('{}'.format(N-K))