#include #include #include using namespace std; int main() { std::cin.tie(0); std::ios::sync_with_stdio(false); int X, Y, L; cin >> X >> Y >> L; int ans = 0; // check rotation if(X == 0){ if(Y < 0){ ans += 2; } }else{ if(Y>=0){ ans++; }else{ ans += 2; } } X = abs(X); Y = abs(Y); // check move int dy = Y / L; if(Y%L!=0) dy++; int dx = X / L; if(X % L != 0) dx++; ans += dy + dx; cout << ans << endl; return 0; }