using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoder { class Program { static void Main(string[] args) { string s = Console.ReadLine(); string[] t = s.Split(' '); int L = int.Parse(t[0]); int K = int.Parse(t[1]); int haruka = 0; int c = L; while(0 <= L) { if(L - (K * 2) <= K * 2) { haruka += L; } L -= (K * 2); haruka++; } Console.WriteLine("{0}", (c-haruka)); //Console.ReadLine(); } } }