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