#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a >> b;
  if (a < b) {
    swap(a, b);
  }
  int x = 0, y = 0, total = 0;
  bool now = true;
  while (a != b) {
    if (now) {
      x++;
      a--;
      total += x;
    } else {
      y++;
      b++;
      total += b;
    }
    now = !now;
  }
  cout << total << "\n";
  return 0;
}
