#include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i, a, b) for(int i=(a);i<=(b);i++) #define RFOR(i, a, b) for(int i=(a);i>=(b);i--) #define MOD 1000000007 #define INF 1000000000 using namespace std; int main(void) { int x, y, l; int count = 0; cin >> x >> y >> l; if (y < 0) { count += 2; } if (x != 0) { count++; } if (abs(x)%l == 0) { count += abs(x) / l; } else { count += abs(x) / l + 1; } if (abs(y) %l == 0) { count += abs(y) / l; } else { count += abs(y) / l + 1; } cout << count << endl; return 0; }