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