import java.util.Scanner; public class No63 { public void run(){ Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int K = sc.nextInt(); int a=L-2*K; int count; if(a >0) count=1; else count=0; while( a > 0){ a=a-2*K; if(a<0) break; count++; } System.out.println(count*K); } public static void main(String[] args) { // TODO Auto-generated method stub new No63().run(); } }