import java.util.Scanner; public class A000063 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int l = s.nextInt(); int k = s.nextInt(); s.close(); int a = 1; while(l-2*k*a>0) { a++; } System.out.println(k*(a-1)); } }