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: #include <iostream>
  #include <algorithm>
  #include <vector>
  #include <set>
  #include <iomanip>
  #include <queue>
  #include <map>
  #define debug(x) std::cerr << #x << " = " << (x) << std::endl
  using namespace std;
  typedef long long LL;
  const int MAXN = 1e5 + 17;
  const int MOD = 1e9 + 17;
  int main(int argc, char const *argv[])
  {
  #ifdef noob
      freopen("Input.txt", "r", stdin);
      freopen("Output.txt", "w", stdout);
  #endif
  	int a,b,c,ans = 0;
  	cin>>a>>b>>c;
  	int mn = min(b,c);
  	ans += 2*mn;
  	c -= mn;
  	ans += min(a,c);
  	cout<<ans<<endl;
      return 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"}]