import numpy as np
from sys import stdin

def main():
    n, k = [int(x) for x in stdin.readline().rstrip().split()]
    if k == 1: print(0)
    else: print(n-k)

if __name__ == "__main__":
    main() import numpy as np numpy from sys import stdin def main():
    n, k = [int(x) for x in stdin.readline().rstrip().split()]
    if k == 1: print(0)
    else: print(n-k) main int(x) for x in stdin.readline().rstrip().split() for x in stdin.readline().rstrip().split() x stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split for x in stdin.readline().rstrip().split() int(x) int x n, k = [int(x) for x in stdin.readline().rstrip().split()] n [int(x) for x in stdin.readline().rstrip().split()] k if k == 1: print(0)
    else: print(n-k) k == 1 k 1 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n, k = [int(x) for x in stdin.readline().rstrip().split()]
    if k == 1: print(0)
    else: print(n-k) def main():
    n, k = [int(x) for x in stdin.readline().rstrip().split()]
    if k == 1: print(0)
    else: print(n-k) main
import numpy as np
from sys import stdin

def main():
    n, k = [int(x) for x in stdin.readline().rstrip().split()]
    if k == 1: print(0)
    else: print(n-k)

if __name__ == "__main__":
    main()