#include <bits/stdc++.h>
using namespace std;
ostream& operator<<(ostream& os, const vector<long long int>& arr) {
  for (int i : arr) os << i << ' ';
  os << endl;
  return os;
}
long long int factorial(long long int x) {
  long long int r = 1;
  while (x) {
    r = r * x;
    x--;
  }
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
unordered_map<long long int, unordered_map<long long int, long long int>> dp;
int rec(int n, int color) {
  if (n == 0) return 1;
  if (n == 1) return 1;
  if (dp.find(n) != dp.end() && dp[n].find(color) != dp[n].end())
    return dp[n][color];
  return dp[n][color] = rec(n - 1, 1 - color) + rec(n - 2, 1 - color);
}
int main() {
  long long int n, m;
  cin >> n >> m;
  dp.clear();
  cout << 2 * rec(n, 0) + 2 * rec(m, 0) - 2 << endl;
  return 0;
}
