#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000000;
int a[MAXN];
int main() {
  const int mod = 1000000000 + 7;
  int m, n;
  cin >> m >> n;
  int maxi = max(m, n);
  a[1] = 2;
  a[2] = 4;
  for (int i = 3; i <= maxi; i++) a[i] = a[i - 1] + a[i - 2];
  cout << a[m] + a[n] - 2 << endl;
  return 0;
}
