#include <bits/stdc++.h>
using namespace std;
vector<long double> arr, brr;
int main() {
  int a, b;
  cin >> a >> b;
  int d = abs(b - a);
  if (d % 2 == 0) {
    d = d / 2;
    long sum = (long)((d) * (d + 1));
    cout << sum << endl;
  } else {
    d = d / 2;
    long sum = long((d) * (d + 1));
    d++;
    sum += (long)d;
    cout << sum << endl;
  }
}
