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