L, K = input().split() L, K = int(L), int(K) leng = 0 bytecount = 0 while leng < L: leng += K*2 bytecount += 1 print((bytecount-1)*K)