#include #include #include #include #include #include #include #include #include using namespace std; #define REP(i, j) for (int i = 0; i < (int)j; ++i) #define FOR(i, j, k) for (int i = (int)j; i < (int)k; ++i) #define SORT(v) sort(v.begin(), v.end()) #define REVERSE(v) reverse(v.begin(), v.end()) typedef complex P; typedef vector VI; typedef long long LL; typedef pair PII; int main() { cin.tie(0); ios::sync_with_stdio(false); int x, y, l; cin >> x >> y >> l; LL o = 0, d = 2; if (y > 0) o += (y % l == 0) ? (y / l) : (y / l + 1); if (x != 0) { o += 1 + ((abs(x) % l == 0) ? (abs(x) / l) : (abs(x) / l + 1)); d = 1; } if (y < 0) { x *= -1; o += d + ((x % l == 0) ? (x / l) : (x / l + 1)); } cout << o << endl; return 0; }