import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner Input = new Scanner(System.in);
        int a = Input.nextInt();
        int b= Input.nextInt();
        if(a<b){
            for (int i=0; a!=b; i++){
                    ++a;
                    if(a!=b){
                        --b;
                        if(a==b){
                            System.out.println(((i+1)*i)+(2*(i+1)));
                        }
                    }else{
                        System.out.println((i+1)*i+(i+1));
                    }
            }
        }
    }
}