import Foundation

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

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

main()
