
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Solution {

	public static void main(String[] args) throws Exception, Exception {
		// TODO Auto-generated method stub
		BufferedReader tc = new BufferedReader(new InputStreamReader(System.in));
		int a=Integer.parseInt(tc.readLine());
		int b=Integer.parseInt(tc.readLine());
		int n=Math.abs(a-b);
		System.out.println(friendsMeeting(n));
		
	}
	private static int friendsMeeting(int n){
		int x=0,ans=0;
		if(n%2==0) {
			x=n/2;
			ans=x*(x+1);
		}
		else {
			ans=(x+1)*(x+1);
			return ans;
		}
		return 0;
	}

}
