#include <bits/stdc++.h>
using namespace std;
const int MAX_V = 10010;
int main() {
  int a, b;
  cin >> a >> b;
  int dif = abs(a - b);
  int ans = 0;
  int t = dif / 2;
  for (int i = 1; i <= t; i++) {
    ans += i * 2;
  }
  dif -= t * 2;
  if (dif & 1) ans += t + 1;
  cout << ans << endl;
  return 0;
}
