a=[int(i) for i in input().split()] c=a[0]//(a[1]*2) if a[0]>=a[1]*2: print(0) else: print(a[1]*c)