#include using namespace std; #define rep(i,n) for(int (i) = 0 ; (i) < (int)(n) ; (i)++) #define REP(i,a,b) for(int (i) = a ; (int)(i) <= (int)(b) ; (i)++) #define all(n) (n).begin(),(n).end() typedef long long ll; typedef vector Vi; typedef vector VVi; typedef pair Pii; typedef vector VPii; int main(){ long long X,Y,L; cin >> X >> Y >> L; long long ans = (abs(X)+L-1)/L+(abs(Y)+L-1)/L; if( Y < 0 ) ans+= 2; else if( X != 0 ) ans++; cout << ans << endl; }