fn main() { let s = { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); s.trim_right().to_owned() }; let (l, k) = { let mut ws = s.split_whitespace(); let l: u32 = ws.next().unwrap().parse().unwrap(); let k: u32 = ws.next().unwrap().parse().unwrap(); (l, k) }; if l % (2*k) == 0 { println!("{}", l/2 - k); } else { println!("{}", k*(l/(2*k))); } }