
import java.util.Scanner;


public class Main {

  
    public static void main(String[] args) {
         Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int m=s.nextInt();
        double b=Math.abs(m-n);
      
      
        if(b%2==0)
        {System.out.println((int)(b*2)-2);
        }

        
        else{
            System.out.println((int)(b*2)-1);

        }

        }
 

}