The modulo operator is a very commonly used operation in computer science. The result of taking modulo is equal to the remainder of when divided by .
For her ICS homework, Mimi was asked to find the greatest result of mod for all integers in the range . Can you help Mimi do her homework?
Subtask 1 [40%]
Subtask 2 [60%]
The first and only line of input will contain two space separated integers, and .
The greatest result of mod for all integers in the range .