#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int ans = 0;
  int p = 1;
  int diff;
  if (a > b)
    diff = a - b;
  else
    diff = b - a;
  for (int i = 0; i < diff / 2; i++) {
    ans += 2 * p;
    p++;
  }
  ans += diff % 2 * p;
  cout << ans << "\n";
  return 0;
}
