#include using namespace std; int main() { int x, y; cin >> x >> y; int r; int sqrt = x * x + y * y; for (int i = 0; i < 150000; ++i) { int tmp = i * i; if (tmp == sqrt) r = i; } cout << r * 2 + 1 << endl; }