#include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; #define mod 1000003 #define INF 1000000000 #define LLINF 2000000000000000000LL #define SIZE 100 int main(){ int x,y,l; int ans=0; scanf("%d%d%d",&x,&y,&l); if(y>0 && x!=0) ans++; if(y==0 && x!=0) ans++; if(y<0) ans+=2; x = abs(x); y = abs(y); ans+= (x+l-1)/l + (y+l-1)/l; cout << ans << endl; return 0; }