#include"bits/stdc++.h" using namespace std; int main() { int x,y,L; cin >> x >> y >> L; int ans=0; // 移動操作の計算 if (y%L == 0) ans += abs(y) / L; else ans += abs(y) / L + 1; if (x%L == 0) ans += abs(x) / L; else ans += abs(x) / L + 1; // 回転操作の計算 if (y >= 0 && x!=0) { ans++; } else if (y < 0) { ans += 2; } cout << ans << endl; }