#include #include using namespace std; int main(void){ int x, y; cin >> x >> y; cout << (int)(hypot(x, y) * 2 + 1) << endl; return 0; }