#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, mini, maxi;
  cin >> a >> b;
  mini = min(a, b);
  maxi = max(a, b);
  int dif = maxi - mini;
  if (dif <= 3)
    cout << dif << endl;
  else if (dif % 2 == 0) {
    int N = dif / 2;
    cout << (N * (N - 1)) * 2 << endl;
  } else {
    int N = (dif + 1) / 2;
    cout << ((N * (N - 1)) * 2) - N << endl;
  }
  return 0;
}
