X,Y,L = input(),input(),input() if abs(X)%L == 0 and abs(Y)%L == 0: A = abs(X)/L+abs(Y)/L elif abs(X)%L == 0 and abs(Y)%L != 0: A = abs(X)/L+abs(Y)/L+1 elif abs(X)%L != 0 and abs(Y)%L == 0: A = abs(X)/L+1+abs(Y)/L else: A = abs(X)/L+1+abs(Y)/L+1 if X == 0 and Y >= 0: pass elif X > 0 and Y >= 0: A = A + 1 elif X > 0 and Y < 0: A = A + 2 elif X < 0 and Y < 0: A = A + 2 elif X < 0 and Y >= 0: A = A + 1 else: pass print A