Let's call a string good if and only if it consists of only two types of letters — 'a' and 'b' and every two consecutive letters are distinct. For example "baba" and "aba" are good strings and "abb" is a bad string.

You have $a$ strings "a", $b$ strings "b" and $c$ strings "ab". You want to choose some subset of these strings and concatenate them in any arbitrarily order.

What is the length of the longest good string you can obtain this way?


-----Input-----

The first line contains three positive integers $a$, $b$, $c$ ($1 \leq a, b, c \leq 10^9$) — the number of strings "a", "b" and "ab" respectively.


-----Output-----

Print a single number — the maximum possible length of the good string you can obtain.


-----Examples-----
Input
1 1 1

Output
4

Input
2 1 2

Output
7

Input
3 5 2

Output
11

Input
2 2 1

Output
6

Input
1000000000 1000000000 1000000000

Output
4000000000



-----Note-----

In the first example the optimal string is "baba".

In the second example the optimal string is "abababa".

In the third example the optimal string is "bababababab".

In the fourth example the optimal string is "ababab".

Difficulty: interview

Starter code:

Solutions:
a, b, c = list(map(int, input().split()))
x = 2 * (c + min(a, b))
if a != b:
    x += 1
print(x)


a, b, c = list(map(int, input().split()))
a += c
b += c
if a == b:
	print(a + b)
else:
	print(min(a, b) * 2 + 1)


import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)


def main():
    a,b,c = LI()
    r = min(a,b) * 2
    if a != b:
        r += 1

    return r + c * 2


print(main())



a,b,c=list(map(int,input().split()))
print(2*c+2*min(a,b)+(a!=b))


a, b, c = map(int, input().split())
s = min(a, b)
print(2*(c + s) + min(1, (a-s)) + min(1, (b-s)))

a,b,c=map(int,input().split())
print(min(a,b)*2+(1 if a!=b else 0)+c+c)


import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:list(map(int,input().split()))

a,b,c=mii()
d=min(a,b)
a-=d
b-=d
c+=d

print(c*2+min(1,max(a,b)))



a,b,c=map(int,input().split())
print(2*c+2*min(a,b)+int(a>b)+int(b>a))

x,y,z=map(int,input().split())
ans=0
ans+=2*z+2*min(y,x)
f=min(y,x)
y=y-f
x=x-f
print(ans+min(1,max(y,x)))

a,b,c=[int(k) for k in input().split(" ")]

m=min(a,b)
M=min(m+1,max(a,b))

res=m+M+2*c

print(res)

a, b, c = map(int, input().split())
res = 2 * c
x = min(a, b)
res += 2 * x
if a - x > 0: res += 1
if b - x > 0: res += 1
print(res)

a, b, c = list(map(int, input().split()))
ans = 2 * c
m = min(a, b)
a -= m
b -= m
ans += 2 * m
if a + b > 0:
    ans += 1
print(ans)


a,b,c= map(int,input().split())

if a == b:
  print(2*c + 2*a)
else:
  print(2*c + min(a,b) * 2 + 1)

a, b, ab = [int(x) for x in input().split()]

if a > b:
    print(2*ab + 2*b + 1)
elif a == b:
    print(2*ab + 2*a)
else:
    print(1 + 2*ab + 2*a)


a,b,c=[int(x) for x in input().split()]
if a==b:
    print(a+2*c+b)
else:
    print(2*min(a,b)+1+2*c)


read = lambda: map(int, input().split())
a, b, c = read()
ans = c*2 + (b*2 if a == b else min(a, b)*2 + 1)
print(ans)


def main():
    buf = input()
    buflist = buf.split()
    A = int(buflist[0])
    B = int(buflist[1])
    C = int(buflist[2])
    length = 2 * C
    length += 2 * min(A, B)
    u = min(A, B)
    A -= u
    B -= u
    if A > 0 or B > 0:
        length += 1
    print(length)

def __starting_point():
    main()

__starting_point()

n, m, k = map(int, input().split())
if n != m:
    print((min(n, m) * 2 + 1)  + 2 * k)
else:
    print(n * 2 + 2 * k)

from sys import stdin
# stdin=open('input.txt')

def input():
	return stdin.readline().strip()


# from sys import stdout
# stdout=open('input.txt',mode='w+')

# def print1(x, end='\n'):
# 	stdout.write(str(x) +end)


# a, b = map(int, input().split())

# l = list(map(int, input().split()))


# CODE BEGINS HERE.................

a, b, c = list(map(int, input().split()))

print(2 * c + 2 * min(a, b) + (a - min(a, b) > 0 or b - min(a, b) > 0))


# CODE ENDS HERE....................
# stdout.close()



a, b, c = map(int, input().split())
q = c * 2 + min(a, b) * 2
if a!=b:
    q+=1
print(q)

a, b, c = map(int, input().split())
m = min(a, b)
a -= m
b -= m
ans = c * 2 + m * 2 + min(1, max(a, b))
print(ans)

import sys
import math
from itertools import permutations
input = sys.stdin.readline

a,b,c=map(int,input().split())

minn=min(a,b)
maxx=max(a,b)

if a!=b:
	print(2*c+2*minn+1)
else:
	print(2*c+2*minn)

(a, b, ab) = (int(x) for x in input().split())
# print(a * 100 + b * 10 + ab)
m = min(a, b)
ans = ab * 2 + 2 * m

a -= m
b -= m

if a or b:
    ans += 1
print(ans)


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
# print = stdout.write
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
a, b, c = mapin()
print(2*(min(a, b))+2*c+(abs(a-b)>0))

a, b, c = map(int, input().split())
print(c * 2 + min(a, b) * 2 + (a != b))