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

print((min(C, A + B + 1) + B))

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

print((B + min(C, A + B + 1)))

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

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

-print((min(C, A + B + 1) + B)) +print((B + min(C, A + B + 1)))