import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); int l = koko.nextInt(); int k = koko.nextInt(); int over = l%(2*k); if(over!=0){ System.out.println((l-over)/2); }else if(over==0){ System.out.println((l-2*k)/2); } } }