#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int a, b;
  cin >> a >> b;
  int c = max(b, a);
  int d = c - min(b, a);
  int x = d / 2, y = (d + 1) / 2;
  int res = x * (x + 1) / 2;
  res += (y * (y + 1) / 2);
  cout << res << endl;
}
