using System; using System.Collections.Generic; namespace ConsoleApp1 { class Program { static void Main(string[] args) { #if LocalDebug var exStdIn = new System.IO.StreamReader("stdin.txt"); System.Console.SetIn(exStdIn); #endif var Input = GetList(); var Length = int.Parse(Input[0]); var Eat = int.Parse(Input[1]); var time = 0; while (true) { if (Length <= (Eat * 2)) { break; } Length -= (Eat * 2); time++; } Console.WriteLine(Eat * time); #if LocalDebug System.Console.ReadKey(); #endif } static int GetData() { return int.Parse(Console.ReadLine()); } static string[] GetList() { return Console.ReadLine().Split(' '); } } }