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