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