#include #include using namespace std; int main() { int x, y; cin >> x >> y; int r = ceil(hypot(x, y)); cout << r * 2 + (r*r == x*x + y*y ? 1 : 0) << endl; }