import java.util.Scanner; public class pre { public static void main(String[] args) { Scanner s = new Scanner(System.in); int l = s.nextInt(), k = s.nextInt(); int ans =0; while((l - 2*k) >0){ l -= 2 * k; ans += k; } System.out.println(ans); } }