import java.util.*; import java.lang.*; import java.io.*; class Main { public static void main (String[] args) { // 入力値の読み込み Scanner sc = new Scanner(System.in); int l = sc.nextInt(); int k = sc.nextInt(); int count=0; while(l > k*2){ l -= k*2; count +=1; } System.out.println(k*count); } }