from math import ceil X = int(input()) Y = int(input()) L = int(input()) count = 0 if Y < 0 : count += 2 else: if X == 0: count -= 1 count += 1 print(ceil(abs(X)/L)+ceil(abs(Y)/L)+count)