#include using namespace std; int main() { long x,y,l; cin >> x >> y >> l; if(y==0){ if(x==0){ cout << 0 << endl; }else{ cout << 1+(abs(x)+l-1)/l << endl; } }else if(y>0){ if(x==0){ cout << (abs(y)+l-1)/l << endl; }else{ cout << 1+(abs(y)+l-1)/l+(abs(x)+l-1)/l << endl; } }else{ cout << 2+(abs(y)+l-1)/l+(abs(x)+l-1)/l << endl; } return 0; }