#include using namespace std; struct btk{btk(){ios::sync_with_stdio(false);cin.tie(0);}}btk; int main() { int X, Y; cin >> X >> Y; cout << static_cast( sqrt( pow( X, 2 ) + pow( Y, 2 ) ) * 2 ) + 1 << endl; return 0; }