import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ long l=sc.nextLong(); long k=sc.nextLong(); long ans=0; while(true){ if(l-2*k<=0) break; else{ ans+=k; l-=2*k; } } System.out.println(ans); } } }