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