This page is still under construction.

Parts of this page are still being built. What you see may change.

Master Manager Nam Jeonghun

Time limit1sMemory limit128 MB

Summary
Given L left-footed, R right-footed, and A two-footed players, find the largest even team size with equal left and right counts.
Level

Easy2 of 10

Topics
Math, Greedy
Solved
No attempts yet

Problem

Jeonghun was playing a soccer game at an internet cafe when he ran into a problem. The main foot of the players on his team leans to one side.

His team has LL left-footed players, RR right-footed players, and AA two-footed players. A two-footed player may be counted as left-footed, or as right-footed.

Before he picks the eleven starters, Jeonghun tidies up the squad. He first makes the number of left-footed players equal to the number of right-footed players, then releases every player left over. Find the largest number of players that can remain on the team once he is done.

Input

The first line contains the number of left-footed players LL, the number of right-footed players RR, and the number of two-footed players AA, separated by spaces. Each of the three numbers is at least 00 and at most 100100.

Output

Print the largest number of players that can remain on the team.

Examples2

  1. Example 1

    Input
    1 5 2
    
    Expected output
    6
    
  2. Example 2

    Input
    7 7 7
    
    Expected output
    20