#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n, m;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie();
  cout.tie();
  cin >> n >> m;
  int diff = 2, same = 0, only = 2;
  for (int i = 2; i <= max(n, m); i++) {
    int t1 = same, t2 = diff;
    diff = t2 + t1;
    same = t2;
  }
  cout << diff + same + (min(m, n) - 1 ? 2 : 0) << '\n';
}
