
def solve():
    N, K = map(int, input().split())
    print(N - K if K > 1 else 0)


if __name__ == '__main__':
    solve() def solve():
    N, K = map(int, input().split())
    print(N - K if K > 1 else 0) solve N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () 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 if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve def solve():
    N, K = map(int, input().split())
    print(N - K if K > 1 else 0) def solve():
    N, K = map(int, input().split())
    print(N - K if K > 1 else 0) solve

def solve():
    N, K = map(int, input().split())
    print(N - K if K > 1 else 0)


if __name__ == '__main__':
    solve()
