#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long l, r;
  cin >> l >> r;
  if (l > r) swap(l, r);
  long long rast = r - l;
  long long shag = 1, ans = 0;
  for (long long i = 1; i <= rast / 2; i++) {
    ans += shag + shag;
    shag++;
  }
  if (rast % 2 != 0) ans += shag;
  cout << ans;
}
int main() {
  solve();
  return 0;
}
