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