#include <bits/stdc++.h>
int main() {
  int a, b, c = 0, d, e, i, t = 0;
  scanf("%d%d", &a, &b);
  if (a < b) {
    d = a;
    a = b;
    b = d;
  }
  d = a - b;
  if (d % 2 == 0) {
    for (i = 1; c < d; i++) {
      c = c + 2;
      t = t + 2 * i;
    }
  } else {
    for (i = 1; c < d - 1; i++) {
      c = c + 2;
      t = t + 2 * i;
    }
    t = t + i;
  }
  printf("%d", t);
}
