X = int(input()) Y = int(input()) L = int(input()) f = lambda x : abs(x)//L + (1 if x%L else 0) print(f(X) + f(Y) + (2 if Y<0 else (1 if X else 0)))