Santa Claus distributes candies into packages so that the first package contains candy, the second contains candies, and so on up to the -th package, which contains candies. An elf wants to make the number of candies in all packages equal. In each operation, the elf may add one candy to any two different packages.
The input contains a single integer (3 \leq N \leq 100\,000\,000).
Print the minimum number of operations necessary to make the number of candies in all packages equal. If it is impossible, print -1.
Example 1