X = int(input()) Y = int(input()) L = int(input()) T = 0 A = abs(int(X / L)) B = abs(int(Y / L)) if not X % L == 0: A += 1 if not Y % L == 0: B += 1 if Y < 0: T += 2 elif X == 0: pass else: T += 1 print(T + A + B)