import std.stdio, std.conv, std.string, std.algorithm, std.math, std.array;

long calc(int x) {
  return x*(x-1)/2;
}

void main() {
  int n, m;
  readf("%d %d", &n, &m);
  writeln(calc(n)+calc(m));
}
