#include using namespace std; int main() { int x, y; cin >> x >> y; int ans = ceil(2 * sqrt(x*x + y*y) + 0.000001); cout << ans << endl; return 0; }