pocky, eating = map(int, input().split()) count = int((pocky / 2) / eating) if (count == 1): print(0) else: print(eating * a)