#include "bits/stdc++.h" using namespace std; int main() { int X, Y, Z; cin >> X >> Y >> Z; int count = (abs(X) + Z - 1) / Z + (abs(Y) + Z - 1) / Z; if (Y < 0) count += 2; else if (X != 0) count++; cout << count << endl; }