x = int(input()) y = int(input()) l = int(input()) if y>0: if x==0: print((y+l-1)//l) else: print((y+l-1)//l+(abs(x)+l-1)//l+1) elif y==0: if x==0: print(0) else: print((abs(x)+l-1)//l+1) else: print((y+l-1)//l+(abs(x)+l-1)//l+2)