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