
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author LENOVO
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        if (Math.abs(a-b)==2){
            System.out.println("2");
            return;
        }
        int res = (Math.abs(a-b)+1)/2;
        int result=0;
        for (int i=1;i<res;i++){
            result+=(i*2);
        }
        System.out.println(result+res);
    }
    
}
