#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int a;
  int b;
  cin >> a >> b;
  int counter = max(a, b) - min(a, b);
  long long res;
  if (counter > 2)
    if (counter % 2 == 0)
      for (int i = counter / 2; i >= 1; i--) res += i * 2;
    else {
      res = (counter / 2) + 1;
      for (int i = counter / 2; i >= 1; i--) res += i * 2;
    }
  else
    res = counter;
  cout << res;
  return 0;
}
