#include using namespace std; const int64_t INF=999999999; int main() { int A,B; cin>>A>>B; int C=min(A,B); if(A!=B){cout<<2*C<