
from collections import defaultdict
def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
    else:
        print(a - b)






if __name__ == '__main__':
    main()

 from collections import defaultdict def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
    else:
        print(a - b) main a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b if b == 1:
        print(0)
    else:
        print(a - b) b == 1 b 1 print(0) print 0 print(a - b) print a - b a b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
    else:
        print(a - b) def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
    else:
        print(a - b) main

from collections import defaultdict
def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
    else:
        print(a - b)






if __name__ == '__main__':
    main()


