l, k = map(int, input().split()); print((l - 2*k)//2 if l%(2*k)==0 else k*(l//(2*k)))