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