w = list(map(int,input().split())) if w[0] <= 2 * w[1]: print(0) else: print(int((w[0]//(2*w[1]))*w[1]))