#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b;
  cin >> a >> b;
  int diff = abs(a - b);
  if (diff & 1 == 1) {
    int r = diff / 2;
    cout << (r + 1) * (r + 1);
    return 0;
  }
  cout << (diff / 2) * (diff / 2 + 1);
  return 0;
}
