use std::io; fn main() { let mut s = String::new(); io::stdin().read_line(&mut s).unwrap(); let n: u64 = s.trim().parse().unwrap(); let r = ((n as f64)/3.).sqrt() as u64; assert!({ let n_ = 3 * r * r; if n > n_ { n - n_ <= 1000000 } else { n_ - n <= 1000000 } }); println!("{}", r); }