#include <bits/stdc++.h>
using namespace std;
int sum(int a) {
  int ans = (a * (a + 1)) / 2;
  return ans;
}
int main() {
  int a, b;
  if (b < a) {
    swap(a, b);
  }
  cin >> a >> b;
  int ans = 1e9;
  for (int i = a; i <= b; i++) {
    ans = min(ans, sum(i - a) + sum(b - i));
  }
  cout << ans << endl;
  return 0;
}
