X = int(input()) Y = int(input()) L = int(input()) count = 0 if Y > 0: count += (Y-1) // L + 1 if X != 0: count += 1 count += (abs(X)-1) // L + 1 else: if X != 0: count += 1 count += (abs(X)-1) // L + 1 if Y != 0: count += 1 count += (abs(Y)-1) // L + 1 print(count)