X = gets.to_i Y = gets.to_i L = gets.to_i m = if Y < 0 2 elsif X.abs > 0 1 else 0 end ans = (X.abs + L - 1) / L + (Y.abs + L - 1) / L + m puts ans