#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>

using namespace std;
typedef long long int lint;

int main()
{
	int X, Y, L, turn, ans = 0;

	cin >> X >> Y >> L;
	if (Y >= 0) {
		if (X == 0) turn = 0;
		else turn = 1;
	}
	else turn = 2;

	X = abs(X);
	Y = abs(Y);

	if (X > 0) {
		ans += X / L;
		if (X % L != 0) ans++;
	}
	if (Y > 0) {
		ans += Y / L;
		if (Y % L != 0) ans++;
	}
	ans += turn;

	cout << ans << endl;

	return 0;
}