import java.util.*;
public class A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		int n = Math.abs(a-b);
		
		if(n%2 == 0)
		{
			System.out.println(n*((n/2)+1)/2);
		}
		else
		{
			int s = n*((n/2)+1)/4;
			int s2 = (n+1)*((n/2)+2)/4;
			System.out.println(s+s2);
		}

	}

}
