#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, a, b;
  cin >> a >> b;
  if (a < b) swap(a, b);
  int tval = a - b;
  int val = tval / 2;
  int ans = (val * (val + 1));
  if (tval % 2 == 1) ans = ans + val + 1;
  cout << ans << endl;
}
