#include <bits/stdc++.h>
using namespace std;
int f[250000];
int n, m;
int main() {
  cin >> n >> m;
  f[1] = 2;
  f[2] = 4;
  for (int i = 3; i <= n + m; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  cout << f[n] + f[m] - 2;
  return 0;
}
