using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace algo { class Program { static void Main(string[] args) { string[] N = Console.ReadLine().Split(' '); ulong L = ulong.Parse(N[0]); ulong K = ulong.Parse(N[1]); ulong ans = 0; while(L > K * 2) { L -= K * 2; ans += K; } Console.WriteLine(ans); } } }