#include int main() { int A, B; std::cin >> A >> B; std::cout << (A == 1 && B == 1 ? 1 : std::min(A, B) * 2) << "\n"; }