L,K=map(int,input().split()) if L//(2*K)==1: print(0) else: print(L//(2*K)*K)