#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;

int main(){
	int x,y,d; cin>>x>>y>>d;
	
	int order=0;
	if(y>0&&x==0) order+=0;
	else if(y<=0&&x==0) order+=2;
	else if(y>=0&&x!=0) order+=1;
	else if(y<0 &&x!=0) order+=2;
	
	x=abs(x); y=abs(y);
	int xt=0; int yt=0;
	if(x%d==0) xt=x/d;
	else xt=x/d+1;
	if(y%d==0) yt=y/d;
	else yt=y/d+1;
	
	order+= xt+yt;
	cout << order << endl;
}