import java.io.BufferedReader;
import java.io.InputStream;
import java.lang.*;
import java.util.*;
public class fan_chipu {
	
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int m = input.nextInt();
		int x = Math.abs(n - m);
		int y = x / 2;
		x -= y;
		int ans = 0;
		boolean OKa = true, OKb = true;
		for(int i = 0;i <= 10000;++i) {
			if(i * (i + 1) / 2 >= x && OKa) {
				ans += i;
				OKa = false;
			}
			if(i * (i + 1) / 2 >= y && OKb) {
				ans += i;
				OKb = false;
			}
		}
		System.out.println(ans);
		input.close();
	}
}