Given a positive integer n, find the minimum number of perfect squares (1, 4, 9, 16, ..., repetitions allowed) that sum to exactly n.
Input format
A single line containing the integer n.
Output format
A single integer: the fewest perfect squares that sum to n.
Constraints
- 1 <= n <= 10000