#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(int i=(a);i<(b);++i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define MOD 1000000007 int main(){ int x,y,L; cin >> x; cin >> y; cin >> L; if(x == 0 && y == 0){ cout << 0 << endl; return 0; } if(x == 0){ if(y > 0){ int c = 0; int l = 0; for(;;){ l+=L; c++; if(l>=y){ cout << c << endl; return 0; } } } else{ int c = 0; int l = 0; for(;;){ l+=L; c++; if(l>=-y){ cout << c+2 << endl; return 0; } } } } if(y == 0){ int c = 0; int l = 0; for(;;){ l+=L; c++; if(l>=abs(x)){ cout << c+1 << endl; return 0; } } } if(y > 0){ x = abs(x); int c = 0; int l = 0; for(;;){ if(x > 0){ x -= min(L,x); c++; } else if(y > 0){ y -= min(L,y); c++; } else{ cout << c+1 << endl; return 0; } } } if(y < 0){ x = abs(x); y = abs(y); int c = 0; int l = 0; for(;;){ if(x > 0){ x -= min(L,x); c++; } else if(y > 0){ y -= min(L,y); c++; } else{ cout << c+2 << endl; return 0; } } } return 0; }