X= int(input()) Y= int(input()) L= int(input()) def move(X, Y, L): x_count= (abs(X) + L - 1) // L +1 if Y > 0: y_count= abs((Y + L - 1) // L) elif Y ==0: y_count= 0 else: y_count= (abs(Y) + L - 1) // L +2 return print(x_count+y_count) move(X, Y, L)