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