import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class VirtualContest {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner in = new Scanner(System.in);	
		int n = in.nextInt();
		int m = in.nextInt();
		int diff = Math.max(m, n) - Math.min(m, n);
		int ans = 0;
		for(int i=0;i<diff;i++) {
			int k = i*(i+1);
			if(k>diff) {
				break;
			}
			else {
				ans = k;
			}
		}
		if(diff%2!=0) {
			ans++;
		}
		System.out.println(ans);
	}
}