#P6581. 远大目标

远大目标

Description

Given OO, find the number of integers AA such that A<O|A|<O.

Since Little Z is too weak, he does not even dare to say |A|<|O|, and can only study the problem |A|<O.

Input Format

One line with one integer OO.

Output Format

One line with one integer: the number of integers AA that satisfy the condition.

3
5
1145141919810
2290283839619
12345
24689

Hint

Sample 1 Explanation

Possible values of AA are 1-1, 00, and 11.

Constraints

  • Subtask 1 (30 points): 0O21010 \le |O| \le 2^{10}-1;
  • Subtask 2 (60 points): 0O23110 \le |O| \le 2^{31}-1;
  • Subtask 3 (10 points): 0O26310 \le |O| \le 2^{63}-1.

O|O| denotes the absolute value of OO.

Hint

If you do not know what absolute value is, you can understand it as:

$$|x| = \begin{cases} x & (x > 0) \\ 0 & (x = 0) \\ -x & (x < 0)\end{cases}$$

Original idea: Meatherm

Translated by ChatGPT 5