import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int a=sc.nextInt(),b=sc.nextInt(); int shorter=0,longer=0; if(a>b){ shorter=b; longer=a; }else{ shorter=a; longer=b; } int i=0; while(shorter>=0){ if(i%2==0)shorter--; else longer--; i++; } System.out.println(i-1); sc.close(); return; } }