import java.util.Scanner;

public class Bear_and_Chase
{
	private static Scanner sc = new Scanner(System.in);
	public static void main(String[] args)
	{
		int n = sc.nextInt(),m = sc.nextInt(),count = Integer.MAX_VALUE;
		for(int i=n+1;i<=m;i++)
		{
			int t = (i-n)*(1+i-n)/2 + (m-i)*(1+m-i)/2;
			count = count>t?t:count;
		}
		System.out.println(count);
	}
}