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