#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) int X,Y; signed main() { cin >> X>>Y; int l = (int)(2 * sqrt(pow(X,2) + pow(Y, 2)) + 1); cout << l << endl; return 0; }