#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair Pr; ll X, Y, L; ll rot_num = 0; ll go_num = 0; int main() { cin >> X >> Y >> L; if (X == 0) { if (Y != 0) { if (Y < 0) rot_num = 2; } } else if (Y == 0) { if (X != 0) { rot_num = 1; } } else { if (Y > 0)rot_num = 1; else rot_num = 2; } if (X != 0) { if (L >= abs(X)) go_num = 1; else { go_num = X / L; if (X % L != 0)go_num++; } } if (Y != 0) { if (L >= abs(Y)) go_num += 1; else { go_num += Y / L; if (Y % L != 0)go_num++; } } cout << go_num + rot_num << endl; return 0; }