#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, -1, 0, 1}; int main() { int X, Y, L; cin >> X >> Y >> L; int ans; if (X > 0 && Y > 0) ans = 1; if (X > 0 && Y == 0) ans = 1; if (X > 0 && Y < 0) ans = 2; if (X == 0 && Y > 0) ans = 0; if (X == 0 && Y == 0) ans = 0; if (X == 0 && Y < 0) ans = 2; if (X < 0 && Y > 0) ans = 1; if (X < 0 && Y == 0) ans = 1; if (X < 0 && Y < 0) ans = 2; ans += (abs(X) + L - 1) / L + (abs(Y) + L - 1) / L; cout << ans << endl; }