using System; using System.Collections.Generic; using System.Linq; class Magatro { static void Main() { int L, K; string[] q = Console.ReadLine().Split(' '); L = int.Parse(q[0]); K = int.Parse(q[1]); int cnt; cnt = L %(2* K) == 0 ? L / (2 * K) - 1 : L / (2 * K); Console.WriteLine(cnt * K); } }