#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  cin >> a >> b;
  int diff = abs(a - b);
  int avrg = ceil(diff / 2);
  c = avrg;
  d = diff - avrg;
  int sum = ((c * (c + 1)) / 2) + ((d * (d + 1)) / 2);
  cout << sum << endl;
  return 0;
}
