#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int a, b, suma = 0, sumb = 0;
  cin >> a >> b;
  int l = (a + b) >> 1, r = a + b - l;
  int j = 1;
  for (int i = a; i <= l; ++i) suma += j++;
  j = 1;
  for (int i = b; i > r; --i) sumb += j++;
  printf("%d\n", suma + sumb);
  return 0;
}
