#include using namespace std; using ll = long long; bool is_integer(double x){ return floor(x) == x; } int main(){ double xp,yp; cin >> xp >> yp; int ans = 0; double dist = sqrt(xp*xp + yp*yp); if(is_integer(dist)){ ans = (ll)dist + 1; }else{ ans = (ll)ceil(dist); } ans *= 2; cout << ans << endl; }