fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n: u64 = s.trim().parse().unwrap(); println!( "{}", (1..n).fold(0, |c, x| { c + (((n * n - x * x) as f64).sqrt().fract() < f64::EPSILON) as u64 }) ) }