import java.util._

object Main {
  def main(args: Array[String]) = {
    val scanner = new Scanner(System.in)
    val n = scanner.nextInt
    val m = scanner.nextInt
    val evenEven = n * (n - 1) / 2
    val oddOdd = m * (m - 1) / 2
    print(evenEven + oddOdd)
  }
}