#abc246d. [abc246_d]2-variable Function

[abc246_d]2-variable Function

Problem Statement

Given an integer NN, find the smallest integer XX that satisfies all of the conditions below.

  • XX is greater than or equal to NN.
  • There is a pair of non-negative integers (a,b)(a, b) such that X=a3+a2b+ab2+b3X=a^3+a^2b+ab^2+b^3.

Constraints

  • NN is an integer.
  • 0leNle10180 \\le N \\le 10^{18}

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer as an integer.


Sample Input 1

9

Sample Output 1

15

For any integer XX such that 9leXle149 \\le X \\le 14, there is no (a,b)(a, b) that satisfies the condition in the statement.
For X=15X=15, (a,b)=(2,1)(a,b)=(2,1) satisfies the condition.


Sample Input 2

0

Sample Output 2

0

NN itself may satisfy the condition.


Sample Input 3

999999999989449206

Sample Output 3

1000000000000000000

Input and output may not fit into a 3232-bit integer type.