import java.util.Scanner; public class Yukicoder63 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int K = sc.nextInt(); int res = 0; while(L > 0) { L -= K * 2; if (L > 0) { res += K; } } System.out.println(res); } }