시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB144684238.182%

문제

Consider packing widgets for shipping where widgets cannot be stacked upon each other (2D packing). Each widget has a 1x1 footprint and is 1 unit high.

Boxes are available in any $W$ by $H$ by 1 size such that $H/2 \leq W \leq 2H$, with $W$ and $H$ being integers. The company wants to minimize the amount of packing material that will be needed to fill empty squares in a box.

Given $N$, the number of widgets to be shipped, what is the smallest number of squares that will be left empty when those widgets are packed for shipping?

입력

Input consists of one line containing an integer $N$, the number of widgets to be packed. $1 \leq N \leq 10^{16}$.

출력

Print a single line containing an integer denoting the minimum number of empty squares.

예제 입력 1

47

예제 출력 1

1

예제 입력 2

523

예제 출력 2

2

예제 입력 3

10000000000001

예제 출력 3

6