object Main extends App {

  import scala.io.StdIn._
  import scala.math._

  val Array(a, b, c) = readLine.trim.split(' ').map(_.toInt)
  val single = math.min(a, c)//cを食べてからaを食べる
  val double = math.min(c - single, b)//aと一緒に食べなかったcとbを一緒に食べる
  val singleN = math.max(b - double, 0)//cと一緒に食べなかったbをそのまま食べる
  val restC = math.min(c - single - double, 1)//最後に余ったcを食べる
  println(
    single + double * 2 + singleN + restC
  )
  @inline
  def lowerBound[T](array: Array[T], target: T)(implicit ord: Ordering[T]): Int = {
    var left = 0
    var right = array.length
    while (left < right){
      val mid = (left + right) / 2
      if (ord.compare(array(mid), target) < 0){
        left = mid + 1
      }else {
        right = mid
      }
    }
    right
  }
  @inline
  def upperBound[T](array: Array[T], target: T)(implicit ord: Ordering[T]): Int = {
    var left = 0
    var right = array.length
    while (left < right){
      val mid = (left + right) / 2
      if (ord.compare(array(mid), target) <= 0){
        left = mid + 1
      }else {
        right = mid
      }
    }
    right
  }
  implicit class Extension[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}