#include <bits/stdc++.h>
#define int long long
#define double long double
using namespace std;
const int MOD = 1000000007;
const int INF = 1e14;
using Graph = vector<vector<int>>;

signed main(){
  int X, Y, L;
  cin >> X >> Y >> L;
  int ans = (abs(X)+L-1)/L + (abs(Y)+L-1)/L;
  if( X != 0 ) ans++;
  if( Y < 0 ) ans++;
  if( X == 0 && Y < 0 ) ans++;
  cout << ans << endl;
}