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