#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, m;
  cin >> a >> b;
  unsigned long long ans;
  if (a > b) swap(a, b);
  m = b - a;
  if (m == 1)
    ans = 1;
  else {
    if (m % 2 == 0) {
      int tmp = m / 2;
      ans = 2 * (((1 + tmp) * tmp) / 2);
    } else {
      int tmp = m / 2;
      ans = 2 * (((1 + tmp) * tmp) / 2) + (m - tmp);
    }
  }
  cout << ans << endl;
  return 0;
}
