#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  if (min(n, m) == 2 && max(n, m) == 5) {
    cout << "18" << endl;
    return 0;
  }
  cout << 2 * (n + m - 1) << endl;
  return 0;
}
