#include #include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i, a, b) for(int i=(a);i<=(b);i++) #define RFOR(i, a, b) for(int i=(a);i>=(b);i--) #define MOD 1000000007 #define INF 1000000000 #define PI 3.14159265358979 using namespace std; typedef pair P; int main(void) { long long int x, y; long long int result; cin >> x >> y; for (long long int i = 0; i <= INF; i++) { if (i*i == x*x + y*y) { result = i * 2 + 1; break; } else if (i*i > x*x + y*y) { result = i * 2; break; } } cout << result << endl; return 0; }