import math X = int(input()) Y = int(input()) L = int(input()) cnt = 0 if X == 0: if Y == 0: cnt = 0 elif Y > 0: cnt += abs(math.ceil(Y/L)) else: cnt += abs(math.ceil(Y/L)) + 2 elif X > 0: if Y == 0: cnt += abs(math.ceil(X/L)) + 1 elif Y > 0: cnt += abs(math.ceil(X/L)) + abs(math.ceil(Y/L)) + 1 else: cnt += abs(math.ceil(Y/L)) + abs(math.ceil(Y/L)) + 2 else: if Y == 0: cnt += abs(math.ceil(X/L)) + 1 elif Y > 0: cnt += abs(math.ceil(X/L)) + abs(math.ceil(Y/L)) + 1 else: cnt += abs(math.ceil(Y/L)) + abs(math.ceil(Y/L)) + 2 print(cnt)