Codeforces Global Round 3
A
Another One Bites The Dust
Codeforces
800
原题
←B →
翻译中…

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.

翻译中…

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".

翻译中…

样例

Input #1
1 1 1
Output #1
4
InputCopy OutputCopy
Input #2
2 1 2
Output #2
7
InputCopy OutputCopy
Input #3
3 5 2
Output #3
11
InputCopy OutputCopy
Input #4
2 2 1
Output #4
6
InputCopy OutputCopy
Input #5
1000000000 1000000000 1000000000
Output #5
4000000000
InputCopy OutputCopy
题目信息
题号
1148A
时间限制
1 s
内存限制
256 MB
标签
贪心

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。