def inpl():
    return list(map(int, input().split()))


N, K = inpl()
print(N - K if K > 1 else 0) def inpl():
    return list(map(int, input().split())) inpl return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split N, K = inpl() N inpl() inpl 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 = inpl() inpl() K def inpl():
    return list(map(int, input().split())) def inpl():
    return list(map(int, input().split())) inpl N, K = inpl() inpl() N
def inpl():
    return list(map(int, input().split()))


N, K = inpl()
print(N - K if K > 1 else 0)