#include <bits/stdc++.h>
using namespace std;
int cnt(int x) { return (x * (x + 1)) / 2; }
int main() {
  int a, b;
  cin >> a >> b;
  int diff = abs(a - b);
  int ans = 2 * cnt(diff / 2);
  if (diff % 2 == 1) ans += (diff / 2) + 1;
  cout << ans << "\n";
}
