#include #include using namespace std; int main(){ int a,b;cin>>a>>b; double c = (double)sqrt(a*a+b*b); cout << ((int)c*2)+(ceil(c)==floor(c)?1:0) << endl; }