#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); long long a, b; cin >> a >> b; assert(1 <= a && a <= 1000000000); assert(1 <= b && b <= 1000000000); long long ok = 100000, ng = 0; while(ok - ng > 1){ long long mid = (ok + ng) / 2; long long s, mid2 = mid * mid; s = mid2 - a - b; if(mid2 >= a + b){ if(4LL * a * b < s * s){ ok = mid; }else{ ng = mid; } }else{ ng = mid; } } cout << ok << endl; }