numbers = input()
numbers = numbers.split(" ")
ball_number = int(numbers[0])
person_number = int(numbers[1])

result = 0

if person_number > 1:
  result = ball_number - person_number
  
print(result) numbers = input() numbers input() input numbers = numbers.split(" ") numbers numbers.split(" ") numbers.split numbers split " " ball_number = int(numbers[0]) ball_number int(numbers[0]) int numbers[0] numbers 0 person_number = int(numbers[1]) person_number int(numbers[1]) int numbers[1] numbers 1 result = 0 result 0 if person_number > 1:
  result = ball_number - person_number
   person_number > 1 person_number 1 result = ball_number - person_number result ball_number - person_number ball_number person_number print(result) print result result = 0 0 result ball_number = int(numbers[0]) int(numbers[0]) ball_number result = ball_number - person_number ball_number - person_number result numbers = input() input() numbers person_number = int(numbers[1]) int(numbers[1]) person_number numbers = numbers.split(" ") numbers.split(" ") numbers
numbers = input()
numbers = numbers.split(" ")
ball_number = int(numbers[0])
person_number = int(numbers[1])

result = 0

if person_number > 1:
  result = ball_number - person_number
  
print(result)
