"use strict";

const main = (input) => {
    const spi = input.split('\n');
    const [n, m] = spi[0].split(' ').map(e => Number(e));
    console.log(n*(n-1)/2 + m*(m-1)/2);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
