2. Political Struggle
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Once in America, a city hosted a congress of three parties, attended by $$$a$$$, $$$b$$$, and $$$c$$$ delegates from the first, second, and third parties, respectively. All delegates want to spend the night in the best hotel "California," and since the total number of arrivals turned out to be $$$3 \times n$$$, the hotel manager decided to allocate $$$n$$$ triple rooms for them.

The porter (a secret supporter of the first party) can assign the guests to the rooms at his discretion. He knows that if two representatives of one party end up in one room with one representative of another party, then those two will convince the third to join their party.

What is the maximum number of members of the first party that can be in the hotel as a result of such accommodation?

Input

Three lines of input contain three non-negative integers: $$$a$$$, $$$b$$$, and $$$c$$$ ($$$0 \le a, b, c \le 10^{8}$$$, $$$a + b + c \ge 3$$$). It is guaranteed that their sum is divisible by 3.

Output

Output a single non-negative integer—the answer to the problem.

Scoring

Solutions that work correctly for $$$a \lt b$$$ and $$$c = 0$$$ will be scored 40 points.

Example
Input
3
2
1
Output
4
Note

In the example, $$$a = 3$$$, $$$b = 2$$$, and $$$c = 1$$$. Since $$$a + b + c = 6 = 3 \times 2$$$, there are two available triple rooms.

If all three delegates of party $$$a$$$ are placed in one room, they will remain three in the morning.

If two delegates of party $$$a$$$ are placed in one room with a representative of party $$$c$$$, and the second room contains two representatives of party $$$b$$$ and a third delegate of party $$$a$$$, then the representative of party $$$c$$$ will join party $$$a$$$, and the representative of party $$$a$$$ from the second room will join party $$$b$$$. In total, there will still be three people in party $$$a$$$.

However, if two delegates of party $$$a$$$ are placed in one room with a representative of party $$$b$$$, and the second room contains one representative from each party, then the representative of party $$$b$$$ from the first room will join party $$$a$$$, and there will be no changes in the second room. In total, there will be four people in party $$$a$$$.

We have considered all options for distributing the delegates among the rooms, and the best result is 4.