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