#include inline long nextInt(void) { long temp; std::cin >> temp; return temp; } int main() { int X, Y, L; int ans = 0; std::cin >> X >> Y >> L; ans += (abs(X) + L - 1) / L; ans += (abs(Y) + L - 1) / L; if( Y < 0 ) { ans += 2; } else if( X != 0 ) { ans += 1; } std::cout << ans << std::endl; return 0; }