import java.util.*;

public class Main {

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int diff = Math.abs(n-m);
		int ans;
		if(diff%2!=0) {
			int ev = diff - 1;
			ans = 2*((ev*(ev +2))/8)+diff/2+1;
		}
		else {
			ans = (diff/2)*((diff*(diff +2))/8)+1;
		}
		System.out.println(ans);
		
	
}}