output_description: Print the maximum number of tasty cookies that Takahashi can eat.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B C
attempt: abc = input().split(" ")
  a = int(abc[0])
  b = int(abc[1])
  c = int(abc[2])
  
  
  def eat(a, b, c, a_flg, b_flg, c_flg, cnt=0):
      # print(str(a) + " " + str(b) + " " + str(c))
      if c_flg:
          if c - 1 < 0:
              return eat(a, b, c, a_flg=a_flg, b_flg=b_flg, c_flg=False, cnt=cnt)
          else:
              return eat(a, b, c - 1, a_flg=a_flg, b_flg=b_flg, c_flg=False, cnt=cnt + 1)
      elif b_flg:
          if b - 1 < 0:
              return eat(a, b, c, a_flg=a_flg, b_flg=False, c_flg=c_flg, cnt=cnt)
          else:
              return eat(a, b - 1, c, a_flg=a_flg, b_flg=b_flg, c_flg=True, cnt=cnt + 1)
      elif a_flg:
          if a - 1 < 0:
              return eat(a, b, c, a_flg=False, b_flg=b_flg, c_flg=c_flg, cnt=cnt)
          else:
              return eat(a - 1, b, c, a_flg=a_flg, b_flg=b_flg, c_flg=True, cnt=cnt)
      else:
          return cnt
  
  
  print(eat(a, b, c, a_flg=True, b_flg=True, c_flg=True, cnt=0))
  
problem_description: Statement
  
  Takahashi has A untasty cookies containing antidotes, B tasty cookies
  containing antidotes and C tasty cookies containing poison.
  
  Eating a cookie containing poison results in a stomachache, and eating a
  cookie containing poison while having a stomachache results in a death. As he
  wants to live, he cannot eat one in such a situation. Eating a cookie
  containing antidotes while having a stomachache cures it, and there is no
  other way to cure stomachaches.
  
  Find the maximum number of tasty cookies that Takahashi can eat.
samples: [{"input": "3 1 4", "output": "5\n    \n\nWe can eat all tasty cookies, in the following order:\n\n  * A tasty cookie containing poison\n  * An untasty cookie containing antidotes\n  * A tasty cookie containing poison\n  * A tasty cookie containing antidotes\n  * A tasty cookie containing poison\n  * An untasty cookie containing antidotes\n  * A tasty cookie containing poison\n\n* * *"}, {"input": "5 2 9", "output": "10\n    \n\n* * *"}, {"input": "8 8 1", "output": "9"}]