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