l, k = map(int, input().strip().split()) ly = 0 lh = 0 n = l // (2*k) r = l // (2*k) if r == 0: n = n - 1 ly = n*k print(ly)