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