import math X = int(input()) Y = int(input()) L = int(input()) a, b = 0, 0 x = math.ceil(abs(X)/L) y = math.ceil(abs(Y)/L) if X != 0 and Y >= 0: r = 1 elif Y < 0: r = 2 else: r = 0 print(x+y+r)