#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int has = b - a;
  int toten = 0, en = 1;
  if (has < 0) has *= -1;
  bool flag = false;
  if (has % 2 == 0) flag = true;
  while (has > 0) {
    if (has == 2) {
      toten += en + en;
      has = 0;
    } else if (has == 1) {
      toten += en;
      has = 0;
    } else {
      has -= 2;
      toten += en + en;
      en++;
    }
  }
  printf("%d\n", toten);
  return 0;
}
