
import java.util.Scanner;


public class Main {
    //1000000000000000000 , 'n'

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        float answ;
        float end = (Math.max(a,b)-Math.min(a,b))/2;
        answ = ((1+end)/2)*end;
        if((Math.max(a,b)-Math.min(a,b)-1)%2!=0){
            System.out.println(answ*2);
        }else{
            System.out.println(answ*2+end+1);
        }
    }
}






