#include using namespace std; int main() { double xp, yp; cin >> xp >> yp; double ans = sqrt(xp * xp + yp * yp) * 2 + 1; cout << ans << endl; }