X = input() Y = input() L = input() ans = (abs(X)+L-1)/L + (abs(Y)+L-1)/L if Y < 0: ans += 2 elif X != 0: ans += 1 print ans