import Foundation

let input_line = readLine()!
let array: [String] = input_line.componentsSeparatedByString(" ")
let even = Int(array[0])!
let odd = Int(array[1])!
var count = 0

// 偶数+偶数の数
if even > 1 {
  count += even * (even-1) / 2
}

// 奇数+奇数の数
if odd > 1 {
  count += odd * (odd-1) / 2
}

print(count)