"use strict";

const main = arg => {

    const input = arg.trim().split(" ")

    const N = parseInt(input[0])
    const M = parseInt(input[1])

    console.log(N * (N - 1) / 2 + M * (M - 1) / 2)
}

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