use std::io; use std::collections::HashMap; fn solve() -> i32 { // input! { // x: i64, // } let x: i32 = input().parse().unwrap(); let mut cubes: HashMap = HashMap::new(); for a in 0..=300i32 { for b in a..=300 { for c in b..=300 { let y = a.pow(3) + b.pow(3) + c.pow(3); if let Some(v) = cubes.get_mut(&y) { *v <<= 9; *v |= c as u128; }else { cubes.insert(y, c as u128); } } } } let mut ans = 0; for d in 0..=300i32 { for e in d..=300 { for f in e..=300 { let y = d.pow(3) + e.pow(3) + f.pow(3); if let Some(v) = cubes.get(&(x - y)) { let mut zero = true; let mut u = *v; while u > 0 || zero { let c = (u & 0x1ff) as i32; if c <= d { ans += 1; } u >>= 9; zero = false; } } } } } return ans; } fn input() -> String { let mut buffer = String::new(); io::stdin().read_line(&mut buffer).unwrap(); return buffer.trim().to_string(); } fn main() { println!("{}", solve()); }