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