#D13010. Ball Distribution

    ID: 10818 Type: Default 2000ms 1073MiB

Ball Distribution

Ball Distribution

Takahashi is distributing N balls to K persons.

If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?

Constraints

  • 1 \leq K \leq N \leq 100
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

N K

Output

Print the maximum possible difference in the number of balls received.

Examples

Input

3 2

Output

1

Input

3 1

Output

0

Input

8 5

Output

3

inputFormat

input are integers.

Input

Input is given from Standard Input in the following format:

N K

outputFormat

Output

Print the maximum possible difference in the number of balls received.

Examples

Input

3 2

Output

1

Input

3 1

Output

0

Input

8 5

Output

3

样例

8 5
3