l,k=gets.split.map(&:to_i) r=l/(2*k) r-=1 if l % (2*k) == 0 p r*k