#include <bits/stdc++.h>
using namespace std;
int a, b, d;
int main() {
  cin >> a >> b;
  d = a - b;
  if (d < 0) d *= -1;
  long long rez = 0;
  rez = (long long)(d / 2) * (d / 2 + 1);
  if (d % 2) rez += d / 2 + 1;
  cout << rez;
  return 0;
}
