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