#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int k = max(a, b), t = abs(a - b);
  int m = t / 2;
  int n = t - m;
  cout << m * (m + 1) / 2 + n * (n + 1) / 2;
}
