import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int length = sc.nextInt(); int a = sc.nextInt(); int yu = 0; int ha = 0; while (true) { if (length-a*2<=0) {break;} length -= a*2; yu += a; ha += a; } System.out.println(yu); } }