#include using namespace std; int main(){ int a,b; cin >> a >> b; a=sqrt(a*a+b*b); if(a%2==0) cout << 2*a+1 << endl; else cout << 2*a << endl; }