fn main() { let mut input = String::new(); let _ = std::io::stdin().read_line(&mut input); let input: Vec = input.trim().split_whitespace().map(|n| n.parse().unwrap()).collect(); let max = input[0] / (input[1] * 2); let mut current_size = input[0]; let mut count = 0; for _i in 0..max { current_size -= input[1]; if current_size <= input[1] { break; } current_size -= input[1]; count += 1; } println!("{}", count * input[1]); }