using System; using System.Collections.Generic; using System.Linq; using static System.Console; class Program { static void Main() { var lk = ReadLine().Split().Select(int.Parse).ToArray(); WriteLine((lk[0] / (lk[1] * 2) + (lk[0]) % (lk[1] * 2) == 0 ? -1 : 0) * lk[0]); } }