//
//  main.swift
//  AtCoderSwiftSample
//
//  Created by Yuga Namba on 2020/03/25.
//  Copyright © 2020 Yuga Namba. All rights reserved.
//

import Foundation

let line1 = readLine()!.components(separatedBy: " ")


let n = Int(line1[0])!
let m = Int(line1[1])!

let a = n*(n-1)/2
let b = m*(m-1)/2

let ans = a + b

print(ans)



