using System; namespace AtCoder { class Program { static void Main() { var inputs = Console.ReadLine().Split(' '); int L = int.Parse(inputs[0]); int K = int.Parse(inputs[1]); int temp = L / (2 * K); int count = L % (2 * K) == 0 ? temp - 1 : temp; Console.WriteLine(count * K); } } }