object Main extends App {
  val sc = new java.util.Scanner(System.in)
  @scala.annotation.tailrec
  def loop(a: Int, b: Int, count: Int, acc: Int): Int = {
    if (count == 0) acc
    else if (a >= b) loop(a - 1, b, count - 1, acc + a)
    else  loop(a, b - 1, count - 1, acc + b)
  }
  println(loop(sc.nextInt(), sc.nextInt(), 2, 0))
}
