object Main extends App {
	val Array(n, m) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
	
	val ans1 = if(n <= 1) 0 else combi(n, 2)
	val ans2 = if(m <= 1) 0 else combi(m, 2)

	println(ans1 + ans2)


	def combi(n: Int, r: Int): Int = {
		if(n==r) return 1
		else if(r == 0) return 1
		else if(r == 1) return n
		else return combi(n-1,r-1) + combi(n-1,r)
	}
}