import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long l = sc.nextLong(); int k = sc.nextInt(); sc.close(); int eat = 0; int yuu = 0; while(eat < l){ if(l <= eat + (k*2)) { break; } eat += k*2; yuu += k; } System.out.println(yuu); } }