#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a;
  cin >> b;
  int diff = abs(a - b);
  int temp1 = diff / 2, temp2 = diff - temp1;
  int res = (temp1 * (temp1 + 1)) / 2 + (temp2 * (temp2 + 1)) / 2;
  cout << res << "\n";
  return 0;
}
