#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int tm = (a + b) / 2;
  int var = abs(tm - a), var1 = abs(tm - b);
  int ans = (var * (var + 1) + var1 * (var1 + 1));
  cout << ans / 2;
}
