This page is still under construction.

Parts of this page are still being built. What you see may change.

Easy Equation

Time limit1sMemory limit64 MB

Summary
Count the number of positive integer 5-tuples (x,y,z,w,t) with x^5 + y^4 + z^3 + w^2 + t = n, for n up to 1e9.
Level

Medium6 of 10

Topics
Math, Brute force, Implementation, Hash map
Solved
No attempts yet

Problem

Find the number of solutions of the equation x5+y4+z3+w2+t=n,x^5 + y^4 + z^3 + w^2 + t = n, where xx, yy, zz, ww, and tt are positive integer variables, and nn is a given positive integer.

Input

A single line contains the integer nn (1≤n≤1091 \le n \le 10^9).

Output

Print the number of solutions on a single line.

Examples3

  1. Example 1

    Input
    12
    
    Expected output
    3
    
  2. Example 2

    Input
    2019
    
    Expected output
    7386
    
  3. Example 3

    Input
    1000000
    
    Expected output
    26734730