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 = {  
      val vars = Seq(n, r)
      
      vars match {
          case Seq(0,r) => 0
          case Seq(1,r) => 1
          case Seq(n,0) => 1
          case _ => if(n == r) {
            val bunshi = List.range(1, vars(0) + 1).product
            val bunbo1 = List.range(1, vars(1) + 1).product
            val bunbo2 = 1
            bunshi / bunbo1
          }else{
            val bunshi = List.range(1, vars(0) + 1).product
            val bunbo1 = List.range(1, vars(1) + 1).product
            val bunbo2 = List.range(1, vars(0) - vars(1) + 1).product
            bunshi / (bunbo1 * bunbo2)   
          }
      }
  }
}