import Foundation

/*
// 1
let N = Int(readLine()!)!

// 1 2
let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let S = Int(split[1])!

// 1 2 3 4 5
let array = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
*/

let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let M = Int(split[1])!

var n = 0
var m = 0
for i in 0..<N {
  n += i
}

for i in 0..<M {
  m += i
}

if N <= 1 { n = 0 }
if M <= 1 { m = 0 }

print(n + m)