#include <bits/stdc++.h>
using namespace std;
void winter_is_coming() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  void winter_is_coming();
  long long a, b, dis, dis2, ans = 0;
  cin >> a >> b;
  dis = abs(a - b);
  dis2 = dis / 2;
  dis = dis - dis2;
  ans = (dis * (dis + 1) / 2) + (dis2 * (dis2 + 1) / 2);
  cout << ans << endl;
  return 0;
}
