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