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