A,B,C = list(map(int,input().split()))

if A+B>=C-1:

    print((B+C))

else:

    print(((A+B+B)+1))
A,B,C = list(map(int,input().split()))

if B>=C:

    print((C+B))

else:

    a = 2*B+min(C-B,A)

    if C-B-A>=1:

        a += 1

    print(a)
A, B, C = list(map(int, input().split()))
if A + B >= C - 1:
    print((B + C))
else:
    print(((A + B + B) + 1))

A, B, C = list(map(int, input().split()))
if B >= C:
    print((C + B))
else:
    a = 2 * B + min(C - B, A)
    if C - B - A >= 1:
        a += 1
    print(a)

-if A + B >= C - 1: -    print((B + C)) +if B >= C: +    print((C + B)) -    print(((A + B + B) + 1)) +    a = 2 * B + min(C - B, A) +    if C - B - A >= 1: +        a += 1 +    print(a)