import java.util.Scanner
object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n:Long = sc.nextLong 
	val m:Long = sc.nextLong

	val c = convolusion(n,2) + convolusion(m, 2)
	println(c)
  }
  


    
    def convolusion(n: Long, r: Long): Long = {
        
        if( n == 0 | n == 1){
            0
        }
        else if(r == 0){
            1
        }
        else {
                        val bunshi = List.range(1, n + 1).product
            val bunbo1 = List.range(1, r + 1).product
            if(n-r == 0){
                val bunbo2 = 1
            }else{
                                val bunbo2 = List.range(1, n-r + 1).product
            }

            return bunshi / (bunbo1 * bunbo2)

            
            bunshi / (bunbo1 * bunbo2)
        }
    }



}
