import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter pw;

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int dp[][] = new int[n][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < n; i++) {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][0];
        }
        int ans = dp[n - 1][0] + dp[n - 1][1] - 1;
        ans = ans * 2;
        dp = new int[m][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < m; i++) {
            dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
            dp[i][1] = dp[i - 1][0];
        }
        int ans2 = dp[m - 1][0] + dp[m - 1][1] - 1;
        ans2 = ans2 * 2;
        pw.println(ans + ans2 + 2);
        pw.close();
    }
}