fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }

    fun factorial(number: Int): Long {
        if (number < 2) return 0.toLong()
        if (number == 2) return 1.toLong()
        if (number == 3) return 3.toLong()

        var molecule = 1.toLong()

        for (i in number - 1..number) {
            molecule *= i
        }

        return molecule / 2.toLong()
    }
    println(factorial(n) + factorial(m))
}
