#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, x, sum = 0, i;
  cin >> a >> b;
  x = abs(a - b);
  int ans = x / 2;
  cout << (x % 2 == 0 ? ans * (ans + 1) : ans * (ans + 1) + ans + 1) << endl;
  return 0;
}
