#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(), cout.tie();
  int a, b;
  float avg = 0;
  cin >> a >> b;
  avg = ceil((a + b) / 2);
  cout << (abs(avg - a) * (abs(avg - a) + 1) / 2) +
              (abs(b - avg) * (abs(b - avg) + 1)) / 2
       << endl;
  return 0;
}
