const main = stdin => {
  const [N, M] = stdin.trim().split(' ').map(x => parseInt(x))
  console.log((N * (N - 1) + M * (M - 1)) / 2)
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
