#include <bits/stdc++.h>
using namespace std;
int sum(int n) { return (n * (n + 1)) / 2; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int x, y;
  cin >> x >> y;
  if ((x + y) % 2)
    cout << sum(((x + y) / 2 + 1) - x) + sum(y - ((x + y) / 2 + 1));
  else
    cout << sum(((x + y) / 2) - x) + sum(y - ((x + y) / 2));
}
