#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << endl;
  err(++it, args...);
}
const int mod = 1e9 + 7;
const int MAX = 1e5 + 5;
long long f[MAX];
void solve() {
  int n, m;
  cin >> n >> m;
  f[0] = f[1] = 1;
  for (int i = 2; i <= MAX; i++) f[i] = f[i - 1] + f[i - 2];
  cout << 2 * (f[n] + f[m] - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
