import math n = list(map(int, input().split())) if n[1] * 2 >= n[0]: print('0') else: number = math.floor(n[0] / (n[1] * 2)) print(number * n[1])