X,Y,L=[int(input())for _ in[0]*3] f=lambda x:(abs(x)+L-1)//L print(f(X)+f(Y)+[X!=0,2][Y<0])