n,m = map(int, input(). split())
if m == n and m == 1:
    print(1)
else:
    d = max(m,n) * [0]
    d[0] = 1
    d[1] = 2
    for i in range(2,len(d)):
        d[i] = d[i-1]+d[i-2]
    print(2*(d[n-1]+d[m-1]-1))