X,Y,L=3.times.map{gets.to_i} sum=(X.abs/L.to_f).ceil+(Y.abs/L.to_f).ceil if X==0 && Y>=0 sum+=0 elsif Y>=0 sum+=1 else sum+=2 end puts sum