#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, r, g;
  scanf("%d %d", &n, &m);
  r = abs(n - m) / 2;
  g = abs(n - m) % 2;
  if (g == 0) {
    printf("%d", r * (r + 1));
  } else {
    printf("%d", r * (r + 1) + r + 1);
  }
  return 0;
}
