#!/usr/bin/env python indat = [int(x) for x in input().split()] div = divmod(indat[0], 2*indat[1]) if div[1] == 0: ans = (div[0] - 1) * indat[1] else: ans = div[0] * indat[1] print(int(ans))