import scala.io.{StdIn => stdin}
import scala.util.{Try, Success}

object AGC030A {
  case class CookieCounts(notDeliciousDetoxic: Int, deliciousDetoxic: Int, toxic: Int)
  def readInput: Option[CookieCounts] = {
    val inputLine = stdin.readLine
    val splitAndToIntResult = Try {
      inputLine.split(" ").map(_.toInt)
    }
    splitAndToIntResult match {
      case Success(intArray) => intArray match {
        case Array(notDeliciousDetoxic, deliciousDetoxic, toxic) => {
          Some(CookieCounts(notDeliciousDetoxic, deliciousDetoxic, toxic))
        }
        case _ => None
      }
      case _ => None
    }
  }

  def calcNumEdibleDeliciousCookie(cc: CookieCounts): Int = {
    val detoxic = cc.notDeliciousDetoxic + cc.deliciousDetoxic
    val delicious = cc.deliciousDetoxic + cc.toxic
    if (detoxic + 1 >= cc.toxic) {
      delicious
    } else {
      detoxic + 1 + cc.deliciousDetoxic
    }
  }

  def main(args: Array[String]) {
    val cookieCounts = readInput match {
      case Some(cc) => cc
      case None => sys.exit(1)
    }
    println(calcNumEdibleDeliciousCookie(cookieCounts))
  }
}
