#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a, b;
void solve() {
  int x = (a + b) / 2;
  int rt = (1 + (x - a)) * (x - a) / 2;
  rt += (1 + b - x) * (b - x) / 2;
  printf("%d\n", rt);
}
int main() {
  while (scanf("%d %d", &a, &b) != EOF) {
    if (a > b) {
      a ^= b;
      b ^= a;
      a ^= b;
    }
    solve();
  }
  return 0;
}
