use std::io::Read; fn main() { let mut buf = String::new(); std::io::stdin().read_to_string(&mut buf).unwrap(); let mut iter = buf.split_whitespace(); let x: isize = iter.next().unwrap().parse().unwrap(); let y: isize = iter.next().unwrap().parse().unwrap(); let l: isize = iter.next().unwrap().parse().unwrap(); let n_rotate = if y < 0 { 2 } else if x != 0 { 1 } else { 0 }; let n_move = (x.abs() - 1) / l + (y.abs() - 1) / l + 2; println!("{}", n_rotate + n_move); }