#include <bits/stdc++.h>
using namespace std;
inline int Gauss(int num) { return num * (num + 1) / 2; }
int main() {
  int a, b;
  cin >> a >> b;
  auto dist = abs(a - b);
  auto res = 2 * Gauss(dist / 2);
  if (dist % 2 == 1) {
    res += dist / 2 + 1;
  }
  cout << res << "\n";
  return 0;
}
