import math X = int(input()) Y = int(input()) L = int(input()) distance = 0 if X != 0: distance += math.ceil(abs(X) / L) + 1 if Y != 0: distance += math.ceil(abs(Y) / L) if X != 0 and Y != 0: distance += 1 if X == 0 and Y < 0: distance += 2 print(distance)