from sys import stdin
input = stdin.readline

n, m = [int(x) for x in input().split()]
dp = [1, 1]
for i in range(max(n, m) + 1):
    dp.append(dp[-2] + dp[-1])
x = dp[m] * 2
y = dp[n] * 2
ans = x + y - 2
print(ans)