#include using namespace std; using ll = long long; template using Pa = pair; template using vec = vector; template using vvec = vector>; int main(){ cin.tie(0); ios::sync_with_stdio(false); int A,B; cin >> A >> B; if(A==1 && B==1) cout << 2 << "\n"; else if(A==1 || B==1) cout << 3 << "\n"; else cout << max(A,B)+2 << "\n"; }