#include using namespace std; template inline T gcd(T a, T b) { return __gcd(a, b); } template inline T lcm(T a, T b) { return a / gcd(a, b) * b; } template inline T floor(T a, T b) { return a / b * b <= a ? a / b : a / b - 1; } template inline T ceil(T a, T b) { return floor(a + b - 1, b); } template inline T round(T a, T b) { return floor(a + b / 2); } int main() { int x, y, l; cin >> x >> y >> l; cout << (y < 0 ? 2 : x != 0 ? 1 : 0) + ceil(abs(x), l) + ceil(abs(y), l) << endl; }