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