#include int main(){ long int X,Y,L,i,j,ans=0,flag=0; scanf("%ld%ld%ld",&X,&Y,&L); if(X<0) X=-X; if(Y<0){ Y=-Y; flag++; } if(X%L==0) ans=ans+X/L; else ans=ans+X/L+1; if(Y%L==0) ans=ans+Y/L; else ans=ans+Y/L+1; if(X!=0) ans++; /* if(Y!=0) ans++; */ if(flag!=0) ans+=2; printf("%ld\n",ans); return 0; }