import java.util.Scanner; public class Main { public static void main(String[] a) { Scanner s=new Scanner(System.in); int L=s.nextInt(),K=s.nextInt(); System.out.println(K*(L/2/K-(L%(2*K)>0?0:1))); } }