#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long a, b;
  cin >> a >> b;
  long long ans1 = 0, ans2 = 0;
  long long d = abs(b - a);
  long long k = d / 2;
  d = d - k;
  ans1 = ((k) * (k + 1)) / 2;
  ans2 = ((d) * (d + 1)) / 2;
  cout << ans1 + ans2;
}
