l, k = list(map(int, input().split())) x = l // (k*2) print([k*x, 0][l <= k*2])