L,K = map(int,input().split()) YUU = 0 while L > 0: L = L-(2*K) YUU += K print(YUU-K)