#include using namespace std; int main() { int X, Y, L; cin >> X >> Y >> L; int stepx, stepy; int rot; stepx = abs(X) / L + ( X%L==0?0:1 ); stepy = abs(Y) / L + ( Y%L==0?0:1 ); if( X == 0 && Y == 0 ) { rot = 0; } else if( X == 0 && Y > 0 ) { rot = 0; } else if( X > 0 && Y > 0 ) { rot = 1; } else if( X > 0 && Y == 0 ) { rot = 1; } else if( X > 0 && Y < 0 ) { rot = 2; } else if( X == 0 && Y < 0 ) { rot = 2; } else if( X < 0 && Y < 0 ) { rot = 3; } else if( X < 0 && Y == 0 ) { rot = 3; } else if( X < 0 && Y > 0 ) { rot = 3; } //cout << stepx << endl; //cout << stepy << endl; //cout << rot << endl; cout << stepx+stepy+rot << endl; return 0; }