import scala.io.{StdIn => in}

object Main extends App {
  var Array(a, b) = in.readLine.split(" ").map(_.toInt)

  def Buttons(a:Int, b:Int) = {
    var acc = 0
    var b1 = a
    var b2 = b
    (cnt:Int) => {
      for(i <- 0 until cnt) {
        if(b1 > b2) {
          acc += b1
          b1 -= 1
        }
        else {
          acc += b2
          b2 -= 1
        }
      }
      acc
    }
  }

  val push = Buttons(a, b)

  val ans = push(2)
  println(ans)
}