import java.util.Scanner;

public class C_594 {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		System.out.println((fib(n + 1) + fib(m + 1) - 1) * 2);
	}
	
	public static int fib(int n){
		if(n==0){
			return 0;
		}
		int a = 1;
		int b = 1;
		for(int i = 1; i < n; i++){
			 b = b + a;
			 a = b - a;
		}
		return a;
	}

}
