#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char c = getchar();
  int p = 1;
  x = 0;
  while (!isdigit(c)) {
    if (c == '-') p = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ '0');
    c = getchar();
  }
  x *= p;
}
long long ans;
int cnt, a, b, dis;
int main() {
  read(a);
  read(b);
  int dis = abs(a - b);
  while (dis >= 2) {
    dis -= 2;
    ans += 2 * (++cnt);
  }
  if (dis) ans += (++cnt);
  cout << ans << endl;
  return 0;
}
