import java.util.Scanner;

fun main (args: Array<String>) {
  val input = Scanner(System.`in`)
  
  while (input.hasNext()) {
    val N = input.nextInt()
    val M = input.nextInt()
    val ways = (N * (N - 1)) / 2 + (M * (M - 1)) / 2
    
    println(ways)
  }
}