def abs(x);x >=0 ? x : -x;end x=gets.to_i y=gets.to_i l=gets.to_i p (abs(x)-1)/l+(abs(y)-1)/l+2+(x!=0 ? 1 : (y<0 ? 1 : 0))+(y<0 ? 1 : 0)