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