There are stones on the table. For coin you can perform one of the following operations:
Remove one stone from the table. You cannot perform this operation if there are no stones on the table.
Put one more stone on the table.
What is the minimum number of coins you need to spend so that the number of stones on the table becomes divisible by ?
Note that is divisible by any number, so if stones remain on the table, the condition of the problem is satisfied.
The only line contains one integer (0 \le n \le 10^9) — the initial number of stones on the table.
Print one integer — the minimum number of coins you need to spend so that the number of stones on the table becomes divisible by .
Example 1
Example 2
Example 3
Example 4
Example 5
Example 6
In the first sample, there are stones on the table initially. is divisible by , so you do not need to spend any coins.
In the second sample, you can pay one coin and remove one stone from the table. Then there will be stones on the table, and is divisible by .
In the third sample, you can pay one coin and put one more stone on the table (so there are stones), and then pay one more coin and put another stone on the table, getting stones, which is divisible by .