#include <bits/stdc++.h>
using namespace std;
long long x, y;
int main() {
  cin >> x >> y;
  long long c = abs(x - y);
  long long x = c / 2;
  long long res = (x) * (x + 1) / 2;
  res = res * 2;
  if (c % 2 == 1) res += x + 1;
  cout << res;
}
