a,b,c=map(int,input().split()) n=0 if b>1: n+=b b%=2 h=min([a,c]) n+=h*2 a-=h c-=h if a==0: n+=c//2 c%=2 elif c==0: n+=1 print(n)