package yukicoder063; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int l=sc.nextInt();//ポッキーの長さ Lmm int k=sc.nextInt();//お互いが1回にかじるポッキーの長さ Kmm int count=0; if(l%(2*k)!=0){ count=l/(2*k); }else if(l%(2*k)==0){ count=l/(2*k)-1; } System.out.println(count*k); } }