#include using namespace std; int main(){ int x,y,k; //x:東西 //y:北南 cin >> x >> y >> k; int ans = 0; if(x != 0)ans += 1; if(x != 0 && y < 0)ans += 1; if(x == 0 && y < 0)ans += 2; ans += abs(y)/k; ans += abs(x)/k; if(y%k != 0)ans += 1; if(x%k != 0)ans += 1; cout << ans << endl; return 0; }