#include #include using namespace std; int main() { int x, y, L, ans = 0; cin >> x >> y >> L; if (y >= 0 && x) { ans++; } else if (y < 0) { ans += 2; } if (x % L) { ans += abs(x) / L + 1; } else { ans += abs(x) / L; } if (y % L) { ans += abs(y) / L + 1; } else { ans += abs(y) / L; } cout << ans << endl; }