import java.util.Scanner; public class Answer { public static void main(String str[]) { Scanner sc = new Scanner(System.in); int length = Integer.valueOf(sc.next()); int oneTime = Integer.valueOf(sc.next()); int i=0; while(oneTime*2 < length) { length -= oneTime*2; i++; } System.out.println(i*oneTime); } }