#include using namespace std; int action (int num, int l) { int count = 0; if (num >= l) { count += num/l; num = num % l; } count += num; return count; } int main () { int x, y, l; cin >> x >> y >> l; if (x < 0) x *= -1; if (y < 0) y *= -1; int count = 0; if (y) count = 1; else if (!y) count = 2; count += action(y,l)+action(x,l); cout << count << endl; return 0; }