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