#include<iostream>
#include<conio.h>
#include<string>
#include<math.h>
using namespace std;

int main(){
	int a,b,i,j,sum;
	float diff;
	
	sum=0;
	
	cout << "Friend 1 : ";
	cin >> a;
	cout << "Friend 2 : ";
	cin >> b;
	diff=ceil((float(a)+float(b))/2);
	for(i=1;i<=abs(diff-a);i++){
		sum=sum+i;
	}
	for (j=1;j<=abs(diff-b);j++){
		sum=sum+j;
	}
	cout <<"Output : " << sum;
	
}
