def f(x):return x//L+(x%L!=0) X,Y,L=[int(input()) for _ in '1'*3] print((Y<0)+((Y<0),1)[X!=0]+f(abs(X))+f(abs(Y)))