import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) { BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in)); String line = ""; try { String[] temps = stdReader.readLine().split(" "); int L = Integer.parseInt(temps[0]); int K = Integer.parseInt(temps[1]); int count = 0; while(L-2*(count+1)*K>0){ count++; } System.out.println(count*K); } catch (IOException e) { e.printStackTrace(); } } }