#include <bits/stdc++.h>
using namespace std;
struct str {
  string name;
  string ip;
  string com;
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b, d;
  cin >> a >> b;
  d = abs(a - b);
  int n = d / 2;
  if (d % 2 == 0)
    cout << n * (n + 1) << endl;
  else
    cout << n * (n + 1) + n + 1 << endl;
  return 0;
  ;
}
