func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let line = readInts()
    let n = line[0]
    let m = line[1]
    
    print(n * (n - 1) / 2 + m * (m - 1) / 2)
}

main()
