#include #include #include #include #include #define REP(i,n) for(int i=0;i<(n);++i) #define SORT(a) sort((a).begin(),(a).end()) #define PB push_back using namespace std; typedef vector VI; typedef queue QI; int main(){ int X, Y, L; cin >> X >> Y >> L; int r = 0; if(X == 0){ if(Y != 0){ if(Y < 0){ r = 2; Y = -Y; } r += (Y - 1) / L + 1; } }else{ if(X < 0){ r = 1; X = -X; } r += 2 + (Y == 0 ? 0 : (Y - 1) / L + 1) + (X - 1) / L; } cout << r << endl; }