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