//yukicoder 98 "円を描こう" //http://yukicoder.me/problems/224 #include using namespace std; int main() { int x, y; cin >> x >> y; double ans = 2 * sqrt(x * x + y * y); if (ans == 2 * sqrt(x * x + y * y)) { cout << (int)++ans << endl; } else { cout << (int)ceil(ans); cout << endl; } return 0; }