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