Competitions

# Root decomposition problem with large constraints

Positive integer $n$ is given. Find how many different numbers among the numbers $n \bmod 1$, $n \bmod 2$, $\ldots$, $n \bmod n$. \InputFile One integer $n$ $(1 \le n \le 10^{12})$. \OutputFile Print one number --- the number of different integers among $n \bmod 1$, $n \bmod 2$, $\ldots$, $n \bmod n$. \Note In the first example we consider only one number: $1 \ bmod 1 = 0$, so the answer is $1$. In the second example we have $2 \bmod 1 = 2 \bmod 2 = 0$, so the answer is $1$. In the third example we have $3 \bmod 1 = 3 \bmod 3 = 0$, and also $3 \bmod 2 = 1$, just two different numbers.
Time limit 1 second
Memory limit 128 MiB
Input example #1
1

Output example #1
1
Input example #2
2

Output example #2
1
Input example #3
3

Output example #3
2
Author Anton Trigub