Universal numbers
Easy
Execution time limit is 2 seconds
Runtime memory usage limit is 256 megabytes
Ibrahim loves to play with numbers. He recently learned how to raise numbers to a power, and he really likes it. Farhad knows this, so he asked Ibrahim the following question: in how many different ways can one represent n as the sum of three numbers with the same integer non-negative base k raised to a non-negative integer.
In other words, you must find the number of different fours of non-negative integers (k, a, b, c), satisfying the equality n = k^a
+ k^b
+ k^c
(k > 0).
Help Ibrahim to solve this problem.
Input
One integer n (4 ≤ n ≤ 10^18
).
Output
Print one integer - the amount of different fours of numbers.
Examples
Input #1
Answer #1
Input #2
Answer #2
Input #3
Answer #3
Submissions 1K
Acceptance rate 13%