#include <bits/stdc++.h>
using namespace std;
int series(int n) { return (n * (n + 1) / 2); }
int main() {
  int a, b, mid, res, A, B;
  cin >> a >> b;
  mid = (a + b) / 2;
  A = abs(mid - a);
  B = abs(b - mid);
  res = series(A) + series(B);
  cout << res << endl;
  return 0;
}
