import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int a = Integer.parseInt(reader.readLine());
        int b = Integer.parseInt(reader.readLine());
        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));
                    }
            }
        }
    }
}