#include #include #include #include #include #include using namespace std; typedef long long LL; int main(){ int x, y; cin >> x >> y; int r = (int)(sqrt(x*x + y*y)); while(r*r <= (x*x + y*y)*4) r++; cout << r << endl; return 0; }