#include using namespace std; const long long INF = 1LL << 60; #define MOD 1000000007; typedef long long ll; #define writeln(n) cout< P; typedef pair Psi; int main() { int x,y,l; cin>>x>>y>>l; int cnt=0; if(x !=0){ int nx = abs(x-0); cnt += nx/l; if(nx%l !=0){ cnt +=nx%l; } cnt++; } if(y !=0){ int ny = abs(y-0); cnt += ny/l; if(ny%l !=0){ cnt +=ny%l; } cnt +=2; } if(y >0){ cnt--; } writeln(cnt); }