t,_k=gets.split.map(&:to_i) i=0 loop { t = t - (_k*2) unless t.positive? break end i += 1 } p i*_k