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