#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  int c = (a + b) / 2;
  int a1 = (c - a);
  int b1 = (b - c);
  cout << a1 * (a1 + 1) / 2 + b1 * (b1 + 1) / 2 << endl;
  cin.get();
  cin.get();
  return 0;
}
