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