#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, ans;
  cin >> n >> m;
  if (n * m == 1)
    ans = 2;
  else if (n * m == 2)
    ans = 4;
  else if (n * m == 3 || n * m == 4)
    ans = 6;
  else if (n * m == 6)
    ans = 8;
  else
    ans = 10;
  cout << ans << endl;
  return 0;
}
