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