#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int cha = m - n;
  if (cha < 0) cha = -cha;
  int c1 = cha / 2, c2 = cha - c1;
  int num = (1 + c1) * c1 / 2 + (1 + c2) * c2 / 2;
  cout << num << endl;
  return 0;
}
