import Foundation

let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
let a=arr[0]
let b=arr[1]
var c=0
if a > 1 {
  for i in 0..<a {
    c+=i
}
}
if b > 1 {
    for i in 0..<b {
    c+=i
}
}
 
print(c)