import java.util.Scanner; class pokkii{ public static void main(String args[]){ Scanner s = new Scanner(System.in); int L = s.nextInt(); int K = s.nextInt(); int i = 0; int sum = 0; while(K * 2 * i < L){ i++; sum += K * 2; } if(sum >= L){ System.out.println(K * (i - 1)); }else{ System.out.println(K * i); } } }