#include <bits/stdc++.h>
static std::unordered_map<int64_t, int64_t> result;
int64_t solve(int64_t n, int64_t m) {
  if (n > m) {
    std::swap(n, m);
  }
  int64_t ind = n * 100001 + m;
  if (result.find(ind) != result.end()) {
    return result[ind];
  }
  int64_t res;
  if (n == 1) {
    res = solve(n, m - 1) + solve(n, m - 2);
  } else if (n == 2) {
    res = solve(n, m - 1) + solve(n - 1, m - 2);
  } else {
    res = solve(n - 1, m - 1) + solve(n - 1, m - 2);
  }
  result[ind] = res;
  return res;
}
int main() {
  int64_t t;
  int64_t n, m;
  scanf("%lld %lld", &n, &m);
  int64_t ind = 1 * 100001 + 1;
  result[ind] = 2;
  ind = 2 * 100001 + 1;
  result[ind] = 4;
  ind = 1 * 100001 + 2;
  result[ind] = 4;
  ind = 2 * 100001 + 2;
  result[ind] = 6;
  printf("%lld", solve(n, m));
  return 0;
}
