#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; ll x, y, l; cin >> x >> y >> l; ll ans = (x == 0 ? 0 : (abs(x)-1)/l+1) + (y == 0 ? 0 : (abs(y)-1)/l+1); if (y<0) ans+=2; else if (x!=0) ans++; cout << ans << endl; return 0; }