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