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