#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>

#define ALL(x) (x).begin(),(x).end()

using namespace std;
int main(){
    int x,y,l,ans = 0;
    cin >> x >> y >> l;
    if(y < 0)ans += 2;
    else if(x != 0)ans++;
    x = x < 0 ? -x : x;
    y = y < 0 ? -y : y;
    ans += y%l != 0 ? 1 + y/l : y/l;
    ans += x%l != 0 ? 1 + x/l : x/l;
    cout << ans << endl;
    return 0;
}