#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ull = unsigned long long; using ll = long long; int main() { int x,y; cin >> x >> y; if(2*ceil(sqrt(x*x+y*y)) == 2*sqrt(x*x+y*y)) cout << 2*ceil(sqrt(x*x+y*y)) +1<< endl; else cout << 2*ceil(sqrt(x*x+y*y)) << endl; }