#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5, mod = 1e9 + 7, inf = 1e18 + 7;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long a, b;
  cin >> a >> b;
  long long t = (b - a) / 2, ans = t * (t + 1);
  if ((b - a) & 1) {
    ans += t + 1;
  }
  cout << ans;
}
