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