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

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


  }
  


    
    def convolusion(n: Int, r: Int): Int = {
        
        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
            val bunbo2 = List.range(1, n-r + 1).product
            
            
            bunshi / (bunbo1 * bunbo2)
        }
    }



}
