#include <bits/stdc++.h>
using namespace std;
long long n, m, dp[100005];
int main() {
  cin >> n >> m;
  int k = max(n, m);
  dp[1] = 1;
  dp[2] = 2;
  for (int i = 3; i <= k; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  long long ans = (dp[n] + dp[m] - 1) * 2;
  cout << ans;
  return 0;
}
