import java.util.Scanner; public class Main{ public static void main(String args[])throws Exception{ Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int K = sc.nextInt(); int time = (L-1)/(2*K); System.out.println(time * K); } }