X,Y,L=[int(input()) for _ in '1'*3] X=abs(X) a=((Y<0)*2,1)[X!=0] Y=abs(Y) print(a+X//L+(X%L!=0)+Y//L+(Y%L!=0))