import java.util.Scanner; public class No63 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int l = sc.nextInt(); int k = sc.nextInt(); int remain = l; int cnt = 0; while (remain > 0) { remain -= 2 * k; cnt++; } int result = k * (cnt - 1); System.out.println(result); sc.close(); } }