import java.util.*; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int length=sc.nextInt(); int eat=sc.nextInt(); int count=0; while(length>eat*2){ length-=eat*2; count++; } System.out.println(eat*count); } }