X = int(input()) Y = int(input()) L = int(input()) x = (abs(X)+L-1)//L y = (abs(Y)+L-1)//L if 0 <= Y and X == 0: count = y elif 0 <= Y and X != 0: count = x + y + 1 elif Y < 0: count = x + y + 2 print(count)