import java.io.*;
import java.util.*;

public class VKA {
	
	static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

	public static void main(String[] args) {
		new VKA().run();
	}
	
	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;
	
	void init() throws FileNotFoundException {
		
		if (ONLINE_JUDGE) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			in = new BufferedReader(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		}
		
		tok = new StringTokenizer("");
	}
	
	void run() {
		try {
			long timeStart = System.currentTimeMillis();
			
			init();
			solve();
			
			out.close();
			
			long timeEnd = System.currentTimeMillis();
			System.err.println("Time = " + (timeEnd - timeStart));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}
	
	String readLine() throws IOException {
		return in.readLine();
	}
	
	String delimiter = " ";
	
	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			String nextLine = readLine();
			if (null == nextLine) return null;
			
			tok = new StringTokenizer(nextLine);
		}
		
		return tok.nextToken(delimiter);
	}
	
	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}
	
	long readLong() throws IOException {
		return Long.parseLong(readString());
	}
	
	int[] readIntArr(int n) throws IOException {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = readInt();
		}
		return a;
	}
	
	long binpow (long a, long n, long m) {
		long res = 1 % m;
		while (n > 0) {
			if ((n & 1) == 1) {
				res *= a;
				res %= m;
				n--;
			} else {
				a *= a;
				a %= m;
				n >>= 1;
			}
		}
		return res;
	}
	
	long gcd (long a, long b) {
		while (b != 0 && a != 0) {
			if (a < b) {
				long t = a;
				a = b;
				b = t;
			}
			a %= b;
		}
		return a + b;
	}
	
	void solve() throws IOException {
		long a = readLong();
		long b = readLong();
		long res = 0;
		long x = Math.max(a, b);
		long y = Math.min(a, b);
		
		if (x - y > 1) {
			res = ((x - y) / 2);
			a = res + (x - y) % 2;
			res *= (res + 1);
			if ((x - y) % 2 != 0) {
				res += a;
			}
		} else {
			res = (x - y);
		}
		
		
		out.println(res);
	}
}