import math a,b = map(int,input().split()) count = a / (b * 2) count = math.floor(count) if count == 1: print(0) else: print(count * b)