
import java.io.PrintWriter;

import java.util.*;
import java.util.Arrays ; 


public class Test{
    static int pos = 0 ; 
static void find(int p ,char[]x,int put[],String s){
    int c= 0 ; 
    for (int i = 0; i < s.length(); i++) {
        if(x[p]==s.charAt(i)){
        c++ ; }
    }
    put[p] = c ;  
}
static int mode(int m ,int[]x ){
    int temp = 0 ; 
    for (int i = x.length-1; i >=0; i--) {
        if(x[i]<=m){
            temp= x[i] ; 
           /// break ; 
             return m-temp ; 
             
        }
    }
     return m-temp ; 
}
static int mode2(int m ,int[]x ){
    int temp = 0 ; 
    for (int i = x.length-1; i >=0; i--) {
        if(x[i]<=m){
            temp= x[i] ; 
           /// break ; 
             return x[i] ; 
             
        }
    }
     return 0 ; 
}
    public static void main(String[] args)  {

        Scanner in = new Scanner(System.in) ;
        PrintWriter pw = new PrintWriter(System.out);
        int n = in.nextInt() ; 
        int m = in.nextInt() ; 
        int sum1= 0 ; 
        int sum2= 0 ; 
       int n1 = Math.max(m, n) ; 
       int m2 = Math.min(m,n) ; 
       
        int []x= new int[n1-m2+1] ; 
        if(x.length>2){
           int split =x.length/2 ; 
            for (int i = 0; i <= split; i++) {
                sum1+=i ; 
            }
            int j= 0 ; 
            for (int i = split; i < x.length; i++) {
                sum2+=j ; 
                j++ ;
            }
         
            pw.println(sum1+sum2) ; 
        }else{
            
            
         pw.println(n1-m2);
        }
            
        pw.close();
    }
}
