#include <bits/stdc++.h>
long power(long int x, long int y) {
  int temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
using namespace std;
int main() {
  int a, b, dif, ans, n, m;
  cin >> a >> b;
  dif = abs(a - b);
  if (dif <= 2)
    ans = dif;
  else {
    n = dif / 2;
    if (dif % 2 == 0)
      ans = (n * (n + 1));
    else
      ans = (n + 1) * (n + 1);
  }
  cout << ans << endl;
  return 0;
}
