#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define lint long long int /* vectoral(26); al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; vectorAL(26); AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; */ int main() { lint X, Y, L; cin >> X >> Y >> L; if (X == 0 && Y >= 0) { cout << (abs(X) + abs(Y)) / L +bool(abs(X)%L)+bool(abs(Y)%L)<< endl; } else if (Y >= 0) { cout << (abs(X) + abs(Y)) / L + 1 + bool(abs(X) % L) + bool(abs(Y) % L) << endl; } else { cout << (abs(X) + abs(Y)) / L + 2 + bool(abs(X) % L) + bool(abs(Y) % L) << endl; } }