using System;
class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.In.ReadLine().Split(new char[] { '\t', ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int[] rgs = { int.Parse(input[0]), int.Parse(input[1]), int.Parse(input[2]) };
            if(rgs[0]>rgs[1]) { int temp = rgs[0]; rgs[0] = rgs[1]; rgs[1] = temp; }
            rgs[1] -= rgs[0];
            Console.WriteLine(rgs[1]>rgs[2]?(rgs[0]+rgs[2])*2:(rgs[1]+rgs[0]+(rgs[2]-rgs[1])/2)*2);
        }
    }

using System;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int [] a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int rez = 0;

                a[2] -= Math.Abs(a[0] - a[1]);
                if (a[2] > 0)
                    rez = (Math.Max(a[0], a[1]) + a[2] / 2) * 2;
                else
                    rez =( Math.Max(a[0], a[1]) + a[2])*2;

            Console.WriteLine(rez);
        }
    }
}

using System;

namespace CSharp
{
    public class _950A
    {
        public static void Main()
        {
            string[] tokens = Console.ReadLine().Split();

            int l = int.Parse(tokens[0]);
            int r = int.Parse(tokens[1]);
            int a = int.Parse(tokens[2]);

            int pairs = Math.Abs(l - r) > a ? Math.Min(l, r) + a : (l + r + a) / 2;
            Console.WriteLine(2 * pairs);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using static System.Array;
using static System.Console;
using static System.Math;

namespace Olymp
{
  public class ProblemSolver
  {
    private readonly Tokenizer input;

    public void Solve()
    {
      var (l, r, a) = input.Read3Int();
      if (l > r)
      {
        var t = l;
        l = r;
        r = t;
      }
      if (l + a <= r)
        Write(2 * (l + a));
      else
        Write(2 * r + (a - r + l) / 2 * 2);
    }

    public ProblemSolver(TextReader input)
    {
      this.input = new Tokenizer(input);
    }
  }

  #region Service classes

  public class Tokenizer
  {
    private readonly TextReader reader;

    public string ReadToEnd() => reader.ReadToEnd();

    public int ReadInt()
    {
      var c = SkipWs();
      if (c == -1)
        throw new EndOfStreamException();
      var isNegative = false;
      if (c == '-' || c == '+')
      {
        isNegative = c == '-';
        c = reader.Read();
        if (c == -1)
          throw new EndOfStreamException("Digit expected, but end of stream occurs");
      }

      if (!char.IsDigit((char)c))
        throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");

      checked
      {
        var result = (char)c - '0';
        c = reader.Read();
        while (c > 0 && !char.IsWhiteSpace((char)c))
        {
          if (!char.IsDigit((char)c))
            throw new InvalidOperationException($"Digit expected, but was: '{(char)c}'");
          result = result * 10 + (char)c - '0';
          c = reader.Read();
        }

        if (isNegative)
          result = -result;
        return result;
      }
    }

    public string ReadLine() => reader.ReadLine();

    public long ReadLong() => long.Parse(ReadToken());

    public double ReadDouble() => double.Parse(ReadToken(), CultureInfo.InvariantCulture);

    public int[] ReadIntArray(int n)
    {
      var a = new int[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadInt();
      return a;
    }

    public (int, int) Read2Int() => (ReadInt(), ReadInt());

    public (int, int, int) Read3Int() => (ReadInt(), ReadInt(), ReadInt());

    public (int, int, int, int) Read4Int() => (ReadInt(), ReadInt(), ReadInt(), ReadInt());

    public (long, long) Read2Long() => (ReadLong(), ReadLong());

    public long[] ReadLongArray(int n)
    {
      var a = new long[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadLong();
      return a;
    }

    public double[] ReadDoubleArray(int n)
    {
      var a = new double[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadDouble();
      return a;
    }

    public string ReadToken()
    {
      var c = SkipWs();
      if (c == -1)
        return null;
      var sb = new StringBuilder();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        sb.Append((char)c);
        c = reader.Read();
      }

      return sb.ToString();
    }

    private int SkipWs()
    {
      var c = reader.Read();
      if (c == -1)
        return c;
      while (c > 0 && char.IsWhiteSpace((char)c))
        c = reader.Read();
      return c;
    }

    public Tokenizer(TextReader reader)
    {
      this.reader = reader;
    }
  }

  internal class Program
  {
    public static void Main()
    {
      var solver = new ProblemSolver(In);
      solver.Solve();
    }
  }

  #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeForces2
{
    class Program
    {
        //950A
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(new char[] { ' ' });
            var l = int.Parse(input[0]);
            var r = int.Parse(input[1]);
            var a = int.Parse(input[2]);

            var result = 0;
            var diffrence = Math.Abs(r - l);
            var biggerTeam = Math.Max(r, l);
            if (diffrence < a)
                result = (biggerTeam + (a - diffrence) / 2 ) * 2;
            else
                result = (Math.Min(r, l) + a) * 2;

            Console.WriteLine(result);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
class Solution
{
    static void Main(string[] args)
    {
        int[] a = Array.ConvertAll(ReadLine().Split(), int.Parse);
        int min = Math.Min(a[0], a[1]);
        while (a[2]>0)
        {
            a[2]--;
            if (a[1] > a[0])
                a[0]++;
            else
            {
                a[1]++;
            }
        }
        WriteLine(Math.Min(a[0],a[1])*2);

    }
}

// https://codeforces.com/problemset/problem/950/a

// 34 CodeForces Buy A Shovel https://codeforces.com/problemset/problem/732/a

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Algos_YakshTefla7
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), el => Convert.ToInt32(el));
            int output = MakeATeam(input[0], input[1], input[2]);

            Console.WriteLine(output);
        }

        static int MakeATeam(int l, int r, int a)
        {
            int x = Math.Min(l, r);
            int diff = Math.Abs(l - r);

            if (diff > a)
                return 2 * (x + a);

            //else

            return 2 * (x + diff + ((a - diff) / 2));
        }
    }
}

using System;
using System.Linq;

namespace AlgoTasks
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] lra = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            int min = Math.Min(lra[0], lra[1]);
            int max = Math.Max(lra[0], lra[1]);
            Console.WriteLine(2 * ((min + lra[2]) <= max ? min + lra[2] : max + ((min + lra[2]) - max) / 2));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
             string[]y=Console.ReadLine().Split(' ');
             int a=int.Parse(y[0]);
             int b=int.Parse(y[1]);
             int c=int.Parse(y[2]);
             while(true)
             {
                  if(c==0)
                  break;
                  if(a>b)
                  {
                       c--;
                       b++;
                  }
                  else if(a<b)
                  {
                       c--;
                       a++;
                  }
                  else if(a==b)
                  {
                       c--;
                       a++;
                  }

             }
             Console.WriteLine(Math.Min(a,b)*2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace Introduction
{

    class Program
    {
        static Reader reader = new Reader();
        static void Main(string[] args)
        {
            int a = reader.NextInt();
            int b = reader.NextInt();
            int c = reader.NextInt();
            while(a>b&&c>0)
            {
                if(a>b)
                {
                    b++;
                    c--;
                }

            }
            while(b > a && c > 0)
            {
                if (b > a)
                {
                    a++;
                    c--;
                }
            }
            if(a>b)
            {
                Console.Write(b*2);
            }
            if(b>a)
            {
                Console.Write(a*2);
            }
            if (a == b)
                if (c % 2 != 0)
                {
                    Console.Write(a + b + c - 1);
                }
                else
                    Console.Write(a + b + c);

        }
    }

    #region Reader Class
    internal class Reader
    {
        int s_index = 0;
        List<string> s_tokens;

        public string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        public int NextInt()
        {
            String s = Next();

            return int.Parse(s);
        }

        public long NextLong()
        {
            String s = Next();

            return long.Parse(s);
        }

        public bool HasNext()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = null;
                s_index = 0;
                var nextLine = Console.ReadLine();
                if (nextLine != null)
                {
                    s_tokens = nextLine.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                    if (s_tokens.Count == 0)
                    {
                        continue;
                    }
                }
                return false;
            }
            return false;
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;

namespace CodeforcesTemplateClean
{

    class Program
    {

        static void Main(string[] args)
        {

            int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int l = arr[0];
            int r = arr[1];
            int a = arr[2];

            while (true)
            {
                if (a > 0)
                {
                    if (l > r)
                    {
                        a--;
                        r++;
                    }
                    else
                    {
                        a--;
                        l++;
                    }
                }
                else
                {
                    if (l > r)
                    {
                        Console.WriteLine(r * 2);
                        return;
                    }
                    else
                    {
                        Console.WriteLine(l * 2);
                        return;
                    }
                }

            }

            //Console.ReadKey();

        }

    }

}

using System.Linq;
using System;

class Solution
{
    static void Main()
    {
        var lra = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var l = lra[0];
        var r = lra[1];
        var a = lra[2];
        if (l < r)
        {
            var tmpL = l;
            l += Math.Min(a, r - l);
            a -= Math.Min(a, r - tmpL);
        }
        else if (l > r)
        {
            var tmpR = r;
            r += Math.Min(a, l - r);
            a -= Math.Min(a, l - tmpR);
        }
        r += a / 2;
        l += a / 2;
        Console.WriteLine(2 * Math.Min(l, r));
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Olympiad
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] split = Console.ReadLine().Split();
            int l = int.Parse(split[0]);
            int r = int.Parse(split[1]);
            int a = int.Parse(split[2]);
            int big = 0;
            int small = 0;
            if(l>=r)
            {
                big = l;
                small = r;
            }
            else
            {
                big = r;
                small = l;
            }
            int people=0;
            if(big>=small+a)
            {
                people += (small + a) * 2;
            }
            else
            {
                a -= (big - small);
                people += big * 2;
                people += (a / 2) * 2;
            }
            Console.WriteLine(people);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;

namespace CodeforcesTemplateClean
{

    class Program
    {

        static void Main(string[] args)
        {

            int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int l = arr[0];
            int r = arr[1];
            int a = arr[2];
            int s;

            if (l + a <= r)
            {
                s = 2 * (l + a);
            }

            else if (r + a <= l)
            {
                s = 2 * (r + a);
            }

            else
            {
                s = l + r + a;
                s -= s & 1;
            }

            Console.WriteLine(s);

            //Console.ReadKey();

        }

    }

}

using System;

namespace Left_handers__Right_handers_and_Ambidexters
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int l = int.Parse(input.Split(' ')[0]);
            int r = int.Parse(input.Split(' ')[1]);
            int a = int.Parse(input.Split(' ')[2]);

            if (l < r)
            {
                int temp = r - l;
                if (temp > a)
                {
                    l += a;
                    temp = r - l;
                    Console.WriteLine((l+r)-temp);
                }
                else
                {
                    l += temp;
                    a -= temp;
                    l += a / 2;
                    r += a / 2;
                    Console.WriteLine(l+r);
                }
            }
            else if (l > r)
            {
                int temp = l - r;
                if (temp > a)
                {
                    r += a;
                    temp = l - r;
                    Console.WriteLine((l + r) - temp);
                }
                else
                {
                    r += temp;
                    a -= temp;
                    l += a / 2;
                    r += a / 2;
                    Console.WriteLine(l + r);
                }
            }
            else
            {
                l += a / 2;
                r += a / 2;
                Console.WriteLine(l+r);
            }
        }
    }
}

//ReSharper disable All
using System;

namespace ConsoleApp1
{
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;

    public class Program
    {
        public static void Main(string[] args)
        {
            int[] k = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int l = k[0], r = k[1], a = k[2];
            int help = 0;

            for (int i = 0; 0 <= a; i++)
            {
                if (a == 0)
                {
                    break;
                }
                if (l > r)
                {
                    a--;
                    r++;
                }
                else if (l < r)
                {
                    a--;
                    l++;
                }
                else if (l == r)
                {
                    a--;
                    if (help != 1)
                    {
                        r++;
                        help = 1;
                    }
                    else
                    {
                        l++;
                        help = 0;
                    }
                }
            }

            Console.WriteLine((r+l+a)-Math.Abs(r-l));
        }
    }

}

using System;
using System.Text;

namespace Task_950A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] mess = Console.ReadLine().Split(new char [] {' '});
            int l = Convert.ToInt32(mess[0]);
            int r = Convert.ToInt32(mess[1]);
            int a = Convert.ToInt32(mess[2]);
            int diff;
            bool rthemost=false;
            if (r>l)
            {
                diff= r-l;
                rthemost=true;
            }
            else if (r<l)
            {
                diff = l-r;
                rthemost= false;
            }
            else
                diff=0;
            int less; int most;
            if (rthemost==false)
                {
                    less=r;
                    most=l;
                }
                else
                {
                    less=l;
                    most=r;
                }
                int answer=0;
            if (diff>a)
                answer=(less+a)*2;
            else if (diff<a)
            {
                less=less+diff;
                a=a-diff;
                answer=(a/2+less)*2;
            }
            else if (diff==a)
            answer=most*2;

            Console.WriteLine(answer);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Komanda
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int l = int.Parse(s[0]);
            int r = int.Parse(s[1]);
            int a = int.Parse(s[2]);
            int min = Math.Min(l, r);
            int max = Math.Max(l, r);
            int diff = max - min;
            min += Math.Min(a, diff);
            a -= Math.Min(a, diff);
            min += a / 2;
            Console.Write(min * 2);

        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Left_handers__Right_handers_and_Ambidexters
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static int Solve(string[] args)
        {
            int l = Next();
            int r = Next();
            int a = Next();

            if (l <= r)
            {
                int d = Math.Min(a, r - l);
                l += d;
                a -= d;
            }
            else
            {
                int d = Math.Min(a, l - r);
                r += d;
                a -= d;
            }
            return 2*Math.Min(l, r) + (a/2)*2;
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LefthandersRighthanders_and_Ambidexters
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);
            int l = n[0];
            int r = n[1];
            int a = n[2];
            //int diff = Math.Abs(l - r);
            int people = 0;
            if (l >= r)
            {
                if (l >= r + a)
                    people = 2 * (r + a);
                else
                {
                    people += Math.Abs(l - r);
                    a -= Math.Abs(l - r);
                    people += l + r + 2 * (a / 2);
                }
            }
            else
            {
                if (r >= l + a)
                    people = 2 * (l + a);
                else
                {
                    people += Math.Abs(l - r);
                    a -= Math.Abs(l - r);
                    people += l + r + 2 * (a / 2);
                }

            }
            Console.WriteLine(people);
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LefthandersRighthanders_and_Ambidexters
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);
            int l = n[0];
            int r = n[1];
            int a = n[2];
            int diff = Math.Abs(l - r);
            //int diff = Math.Abs(l - r);
            //int people = 0;
            //if (l >= r)
            //{
            //    if (l >= r + a)
            //        people = 2 * (r + a);
            //    else
            //    {
            //        people += Math.Abs(l - r);
            //        a -= Math.Abs(l - r);
            //        people += l + r + 2 * (a / 2);
            //    }
            //}
            //else
            //{
            //    if (r >= l + a)
            //        people = 2 * (l + a);
            //    else
            //    {
            //        people += Math.Abs(l - r);
            //        a -= Math.Abs(l - r);
            //        people += l + r + 2 * (a / 2);
            //    }

            //}//this is my solution
            //Console.WriteLine(people);
            if (diff >= a)
            {
                Console.WriteLine(Math.Min(l + a, r + a) * 2);
            }
            else
            {
                a -= diff;
                Console.WriteLine(diff + l + r + 2 * (a / 2));//here diff+l+r==Math.Max(l,r)
            }
                Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int l, r, a;
            var split = Console.ReadLine().Split();

            l = int.Parse(split[0]);
            r = int.Parse(split[1]);
            a = int.Parse(split[2]);

            int max = Math.Max(l, r);
            int min = Math.Min(l, r);

            int raz = max - min;

            if (raz >= a)
                Console.WriteLine((min + a) * 2);
            else if (raz < a)
            {
                var d = a - raz;
                d = d % 2 == 0 ? d : d - 1;
                Console.WriteLine(max * 2 + d);
            }
        }
    }
}

using System;

namespace bowling
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int leftHand = int.Parse(tokens[0]);
            int rightHand = int.Parse(tokens[1]);
            int ambidexters = int.Parse(tokens[2]);

            Console.WriteLine(maxGroupCount(leftHand, rightHand, ambidexters));

        }

        public static int maxGroupCount(int leftHand, int rightHand, int ambidexters)
        {
            if (rightHand < leftHand)
            {
                int temp = rightHand;
                rightHand = leftHand;
                leftHand = temp;
            }

            if (leftHand == 0 && ambidexters == 0) return 0;
            else
            {
                int difference = rightHand - leftHand;
                if (difference == 0) return 2 * leftHand + 2 * (ambidexters / 2);
                else
                {
                    if ((leftHand + ambidexters) <= rightHand) return 2 * (leftHand + ambidexters);
                    else
                    {
                        leftHand += difference; ambidexters -= difference;
                        return 2 * leftHand + 2 * (ambidexters / 2);
                    }

                }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bowling
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int leftHand = int.Parse(tokens[0]);
            int rightHand = int.Parse(tokens[1]);
            int ambidexters = int.Parse(tokens[2]);

            Console.WriteLine(maxGroupCount(leftHand, rightHand, ambidexters));
            //Console.ReadKey();
        }

        public static int maxGroupCount(int leftHand, int rightHand,int ambidexters) {

            if (rightHand < leftHand) {
                int temp = rightHand;
                rightHand = leftHand;
                leftHand = temp;
            }

            if (leftHand == 0 && ambidexters == 0) return 0;
            else {
                int difference = rightHand - leftHand;
                if (difference == 0) return  2 * leftHand + 2 * (ambidexters / 2);
                else {

                    if ((leftHand + ambidexters) <= rightHand) return 2 * (leftHand + ambidexters);
                    else {
                        leftHand += difference; ambidexters -= difference;
                        return  2 * leftHand + 2 * (ambidexters / 2);
                      }

                }
            }
        }
    }
}

using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
class P
{
    static void Main()
    {
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int diff = Math.Abs(a[0] - a[1]);
        int res = 0;
        if (a[2] < diff)
        {
            res = 2 * (Math.Min(a[0], a[1]) + a[2]);
        }
        else
        {
            res = (a.Sum() / 2) * 2;
        }
        Console.WriteLine(res);
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace CF
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            using (var sr = new InputReader(Console.In))
//       using (var sr = new InputReader(new StreamReader("input.txt")))
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            using (var task = new Task(sr, sw)) {
                task.Solve();
//                Console.ReadKey();
            }
        }
    }

    internal class Task : IDisposable
    {
        private readonly InputReader sr;
        private readonly TextWriter sw;
        private bool isDispose;

        public Task(InputReader sr, TextWriter sw)
        {
            this.sr = sr;
            this.sw = sw;
        }

        public void Solve()
        {
            var l = sr.NextInt32();
            var r = sr.NextInt32();
            var a = sr.NextInt32();
            var min = Math.Min(l, r);
            var max = Math.Max(l, r);
            if (max >= min + a) {
                sw.WriteLine((min + a)*2);
            }
            else {
                var o = min + a - max;
                sw.WriteLine((o/2 + max)*2);
            }
        }

        ~Task()
        {
            Dispose(false);
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!isDispose) {
                if (disposing) {
                    if(sr != null)
                        sr.Dispose();

                    if(sw != null)
                        sw.Dispose();
                }

                isDispose = true;
            }
        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;
    private string[] buffer;
    private int seek;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(ReadNextToken());
    }

    private string ReadNextToken()
    {
        if (buffer == null || seek == buffer.Length) {
            seek = 0;
            buffer = NextSplitStrings();
        }

        return buffer[seek++];
    }

    public long NextInt64()
    {
        return Int64.Parse(ReadNextToken());
    }

    public int[] ReadArrayOfInt32()
    {
        return ReadArray(Int32.Parse);
    }

    public long[] ReadArrayOfInt64()
    {
        return ReadArray(Int64.Parse);
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();

            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] mas = Console.ReadLine().Split(' ');
            int[] a = new int[3];

            for (int i = 0; i < 3; i++)
                a[i] = Convert.ToInt32(mas[i]);

            while (a[2] > 0){
                if (a[0] <= a[1]){
                    a[0]++;
                    a[2]--;
                } else{
                    a[1]++;
                    a[2]--;
                }
            }
            int max = Math.Min(a[0], a[1])*2;
            Console.WriteLine(max);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
   class A
   {
     static void Main(string[] args)
     {
       string[] token = Console.ReadLine().Split();

       int l = int.Parse(token[0]);
       int r = int.Parse(token[1]);
       int a = int.Parse(token[2]);

       int lA = 0;

       int min = Math.Min(r,l);
       int max = Math.Max(r,l);

       int sL = max - min;
       min += Math.Min(sL,a);
       lA = a - sL;

       if(lA>1){
         lA = (lA%2==0)?lA/2:(lA-1)/2;
         min += lA;
       }
       min = min * 2;

       Console.WriteLine(min);

     }

   }

}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

namespace CodeforcesTemplate
{
    public static class Permutation
    {
        private static bool Next(ref int[] arr)
        {
            int k, j, l;
            for (j = arr.Length - 2; (j >= 0) && (arr[j] >= arr[j + 1]); j--) { }
            if (j == -1)
            {
                arr = arr.OrderBy(c => c).ToArray();
                return false;
            }
            for (l = arr.Length - 1; (arr[j] >= arr[l]) && (l >= 0); l--) { }
            var tmp = arr[j];
            arr[j] = arr[l];
            arr[l] = tmp;
            for (k = j + 1, l = arr.Length - 1; k < l; k++, l--)
            {
                tmp = arr[k];
                arr[k] = arr[l];
                arr[l] = tmp;
            }
            return true;
        }
        public static IEnumerable<int[]> AllPermutations(int[] arr)
        {
            do yield return arr;
            while (Next(ref arr));
        }
    }

    class Program
    {
        private const string FILENAME = "distance4";

        private const string INPUT = FILENAME + ".in";

        private const string OUTPUT = FILENAME + ".out";

        private static Stopwatch _stopwatch = new Stopwatch();

        private static StreamReader _reader = null;
        private static StreamWriter _writer = null;

        private static string[] _curLine;
        private static int _curTokenIdx;

        private static char[] _whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public static string Check(string s)
        {
            string letters = "aeiouy";

            while (true)
            {
                bool used = false;

                for (int i = 0; i < s.Length - 1; i++)
                {
                    if (letters.Contains(s[i].ToString()) && letters.Contains(s[i + 1].ToString()))
                    {
                        s = s.Remove(i + 1, 1);

                        used = true;
                    }
                }

                if (!used)
                {
                    return s;
                }
            }
        }

        private static string ReadNextToken()
        {
            if (_curTokenIdx >= _curLine.Length)
            {
                //Read next line
                string line = _reader.ReadLine();
                if (line != null)
                    _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    _curLine = new string[] { };
                _curTokenIdx = 0;
            }

            if (_curTokenIdx >= _curLine.Length)
                return null;

            return _curLine[_curTokenIdx++];
        }

        private static int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        private static void RunTimer()
        {
#if (DEBUG)

            _stopwatch.Start();

#endif
        }

        private static void Main(string[] args)
        {

#if (DEBUG)
            double before = GC.GetTotalMemory(false);
#endif

            int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int l = arr[0];
            int r = arr[1];
            int a = arr[2];
            int s;

            if (l + a <= r)
            {
                s = 2 * (l + a);
            }

            else if (r + a <= l)
            {
                s = 2 * (r + a);
            }

            else
            {
                s = l + r + a;
                s -= s & 1;
            }

            Console.WriteLine(s);

#if (DEBUG)
            _stopwatch.Stop();

            double after = GC.GetTotalMemory(false);

            double consumedInMegabytes = (after - before) / (1024 * 1024);

            Console.WriteLine($"Time elapsed: {_stopwatch.Elapsed}");

            Console.WriteLine($"Consumed memory (MB): {consumedInMegabytes}");

            Console.ReadKey();
#endif

        }

        private static int CountLeadZeros(string source)
        {
            int countZero = 0;

            for (int i = source.Length - 1; i >= 0; i--)
            {
                if (source[i] == '0')
                {
                    countZero++;
                }

                else
                {
                    break;
                }

            }

            return countZero;
        }

        private static string ReverseString(string source)
        {
            char[] reverseArray = source.ToCharArray();

            Array.Reverse(reverseArray);

            string reversedString = new string(reverseArray);

            return reversedString;
        }

        private static int[] CopyOfRange(int[] src, int start, int end)
        {
            int len = end - start;
            int[] dest = new int[len];
            Array.Copy(src, start, dest, 0, len);
            return dest;
        }

        private static string StreamReader()
        {

            if (_reader == null)
                _reader = new StreamReader(INPUT);
            string response = _reader.ReadLine();
            if (_reader.EndOfStream)
                _reader.Close();
            return response;

        }

        private static void StreamWriter(string text)
        {

            if (_writer == null)
                _writer = new StreamWriter(OUTPUT);
            _writer.WriteLine(text);

        }

        private static int BFS(int start, int end, int[,] arr)
        {
            Queue<KeyValuePair<int, int>> queue = new Queue<KeyValuePair<int, int>>();
            List<bool> visited = new List<bool>();
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                visited.Add(false);
            }

            queue.Enqueue(new KeyValuePair<int, int>(start, 0));
            KeyValuePair<int, int> node;
            int level = 0;
            bool flag = false;

            while (queue.Count != 0)
            {
                node = queue.Dequeue();
                if (node.Key == end)
                {
                    return node.Value;
                }
                flag = false;
                for (int i = 0; i < arr.GetLength(0); i++)
                {

                    if (arr[node.Key, i] == 1)
                    {
                        if (visited[i] == false)
                        {
                            if (!flag)
                            {
                                level = node.Value + 1;
                                flag = true;
                            }
                            queue.Enqueue(new KeyValuePair<int, int>(i, level));
                            visited[i] = true;
                        }
                    }
                }

            }
            return 0;

        }

        private static void Write(string source)
        {
            File.WriteAllText(OUTPUT, source);
        }

        private static string ReadString()
        {
            return File.ReadAllText(INPUT);
        }

        private static void WriteStringArray(string[] source)
        {
            File.WriteAllLines(OUTPUT, source);
        }

        private static string[] ReadStringArray()
        {
            return File.ReadAllLines(INPUT);
        }

        private static int[] GetIntArray()
        {
            return ReadString().Split(' ').Select(int.Parse).ToArray();
        }

        private static double[] GetDoubleArray()
        {
            return ReadString().Split(' ').Select(double.Parse).ToArray();
        }

        private static int[,] ReadINT2XArray(List<string> lines)
        {
            int[,] arr = new int[lines.Count, lines.Count];

            for (int i = 0; i < lines.Count; i++)
            {
                int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

                for (int j = 0; j < lines.Count; j++)
                {
                    arr[i, j] = row[j];
                }
            }

            return arr;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Math;

namespace ProblemA
{
	public class Problem
	{
		int a;
		int r;
		int l;

		public int[] Read()
		{
			return Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
		}

		public Problem()
		{
			var v = Read();
			l = v[0];
			r = v[1];
			a = v[2];
		}

		public void Solve()
		{
			var min = Min(l, r);
			var max = Max(l, r);
			var min2 = Min(a, max - min);
			a = Max(0, a - min2);
			Console.WriteLine((min + min2 + a / 2) * 2);
		}
	}

	class ProblemA
	{
		static void Main(string[] args)
		{
			new Problem().Solve();
		}
	}
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = false;
#else
const bool testing = false;
#endif

    static void program(TextReader input)
    {
       // var n = int.Parse(input.ReadLine());
        var data = input.ReadLine().Split(' ').Select(int.Parse).ToList();
        var l = data[0];
        var r = data[1];
        var a = data[2];
        var i = 400;
        for (; i > 0; i-=2)
        {
            var left = i / 2;
            var right = left;
            left -= l;
            right -= r;
            var need = 0;
            need = Math.Max(0, left) + Math.Max(0, right);
            if(need <= a)
            {
                break;
            }
        }

        Console.WriteLine(i);
    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("6\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("1 4 2\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("14\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("5 5 5\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("0\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("0 2 0\n"));
        Console.WriteLine();

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), s => (int.Parse(s)));
            int l = arr[0];
            int r = arr[1];
            int both = arr[2];

            bool flag = true;
            bool check = true;
            while (both > 0)
            {
                flag = false;
                if (l == r && both == 1)
                {
                    if ((l + r) % 2 == 0)
                    {
                        Console.WriteLine(l + r);
                    }
                    else
                    {
                        Console.WriteLine((l + r) - 1);
                    }
                    check = false;
                    break;

                }
                else
                {
                    if (l == r && both > 0)
                    {
                        l++;
                        both--;
                    }
                    else if (l > r && both > 0)
                    {
                        r++;
                        both--;
                    }
                    else if (r > l && both > 0)
                    {
                        l++;
                        both--;
                    }
                }
            }
            if (check)
            {
                if (flag)
                {
                    if (l != r)
                    {
                        Console.WriteLine(Math.Min(l, r) * 2);
                    }
                    else
                    {
                        Console.WriteLine(Math.Min(l,r)*2);
                    }
                }
                else
                {
                    if ((l + r) % 2 == 0)
                    {

                        Console.WriteLine(Math.Min(l, r) * 2);
                    }
                    else
                    {
                        int ans = Math.Min(l, r) * 2;

                        Console.WriteLine(ans--);
                    }
                }
               // Console.ReadLine();
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace Left_handers__Right_handers_and_Ambidexters
{
    class Program
    {
        static void Main(string[] args)
        {
            String[] inputs = Console.ReadLine().Split(' ');
            int left = Convert.ToInt32(inputs[0]);
            int right = Convert.ToInt32(inputs[1]);
            int ambi = Convert.ToInt32(inputs[2]);
            int difference = Math.Abs(left - right);

            if (difference > ambi)
            {
                // The difference is greater than can be covered by stacking all ambi on one side
                // Stack all ambi on lower side
                Console.WriteLine(Math.Min(left + ambi, right + ambi) * 2);
            }
            else if (difference <= ambi)
            {
                ambi -= difference;

                Console.WriteLine((Math.Max(left, right) + (ambi / 2)) * 2);
            }
        }
    }
}

using System;
using System.Collections.Generic;

namespace CodeForces
{
    static class Program
    {
        static void Main()
        {
            const string filePath = @"Data\R469A.txt";
            if (System.IO.File.Exists(filePath))
            {
                Console.SetIn(new System.IO.StreamReader(filePath));
            }

            IProblem counter = new R469A();

            foreach (var result in counter.GetResults())
            {
                Console.WriteLine(result);
            }
        }
    }

    internal class R469A : ProblemBase
    {
        public override IEnumerable<string> GetResults()
        {
            var ints = this.ReadIntArray();
            var l = ints[0];
            var r = ints[1];
            var a = ints[2];

            var b = Math.Min(l, r);
            var over = Math.Max(l - b, r - b);
            if (a >= over)
            {
                b += over;
                a -= over;
                b += a / 2;
            }
            else
            {
                b += a;
            }

            yield return (b*2).ToString();
        }
    }

    internal class R469B : ProblemBase
    {
        public override IEnumerable<string> GetResults()
        {
            yield return "n/a";
        }
    }
    internal class R469C : ProblemBase
    {
        public override IEnumerable<string> GetResults()
        {
            yield return "n/a";
        }
    }
    internal class R469D : ProblemBase
    {
        public override IEnumerable<string> GetResults()
        {
            yield return "n/a";
        }
    }

    abstract class MultipleTestsBase : ProblemBase
    {
        public sealed override IEnumerable<string> GetResults()
        {
            var t = Convert.ToInt32(Console.ReadLine());
            for (int testCaseNumber = 0; testCaseNumber < t; testCaseNumber++)
            {
                foreach (var result in GetTestResult(testCaseNumber + 1))
                {
                    yield return result;
                }

            }

        }

        protected abstract IEnumerable<string> GetTestResult(int caseNumber);
    }

    public interface IProblem
    {
        IEnumerable<string> GetResults();
    }

    public abstract class ProblemBase : IProblem
    {
        /// <summary>
        /// Pring array of T
        /// </summary>
        /// <typeparam name="T">Generic paramter.</typeparam>
        /// <param name="items">The items.</param>
        /// <param name="prefixMessage">The message shown first.</param>
        public void PrintArray<T>(IEnumerable<T> items, string prefixMessage)
        {
            Console.WriteLine("{0}: {1}", prefixMessage, string.Join(",", items));
        }

        public void WriteDiagnostics(string message, params object[] objects)
        {
            Console.WriteLine(message, objects);
        }

        public virtual IEnumerable<string> GetResults()
        {
            yield return "No result";
        }

        protected int[] ReadIntArray()
        {
            return Array.ConvertAll(ReadTokens(), Convert.ToInt32);
        }

        protected string[] ReadTokens()
        {
            var readLine = Console.ReadLine();
            if (readLine == null)
            {
                throw new Exception("Value read from Console is null");
            }
            return readLine.Split(' ');
        }

        protected int ReadInt32()
        {
            return Convert.ToInt32(Console.ReadLine());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string[] tokens = input.Split();
            int l = Convert.ToInt32(tokens[0]);
            int r = Convert.ToInt32(tokens[1]);
            int a = Convert.ToInt32(tokens[2]);
            int res = 0;
            if (l == r) {
                res = 2 * l + (a / 2) * 2;
            } else if (l < r) {
                if (a >= r-l) {
                    res = 2 * r + ((a - (r - l)) / 2) * 2;
                } else {
                    res = 2 * (l + a);
                }
            } else {
                if (a >= l - r) {
                    res = 2 * l + ((a - (l - r)) / 2) * 2;
                } else {
                    res = 2 * (r + a);
                }

            }
            Console.WriteLine(res);
        }

    }
}

using System;

class Program
{
    static void Main()
    {
        string[] temp_d = Console.ReadLine().Split(' ');
        int l, r, a,max,min,res;
        l = int.Parse(temp_d[0]);
        r = int.Parse(temp_d[1]);
        a = int.Parse(temp_d[2]);
        if (l > r)
        {
            max = l; min = r;
        }
        else
        {
            max = r; min = l;
        }
        res = (max -(max-min))*2;
        max -= min;
        if (max > a)
        {
            res += (max -( max- a))*2;
            a = 0;
        }
        else if (max!=0)
        {
            res += (a-(a-max))*2;
            a -= max;
        }
        res += (a / 2)*2;
        Console.WriteLine(res);
        Console.ReadLine();
    }
}

using System;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int [] a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int rez = 0;
            if (a[1] == 0)
                rez = Math.Min(a[1], a[0]) * 2;
            else
            {
                a[2] -= Math.Abs(a[0] - a[1]);
                if (a[2] > 0)
                    rez = (Math.Max(a[0], a[1]) + a[2] / 2) * 2;
                else
                    rez =( Math.Max(a[0], a[1]) + a[2])*2;
            }

            Console.WriteLine(rez);
        }
    }
}

// https://codeforces.com/problemset/problem/950/a

// 34 CodeForces Buy A Shovel https://codeforces.com/problemset/problem/732/a

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Algos_YakshTefla7
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), el => Convert.ToInt32(el));
            int output = MakeATeam(input[0], input[1], input[2]);

            Console.WriteLine(output);
        }

        static int MakeATeam(int l, int r, int a)
        {
            int x = Math.Min(l, r);
            int diff = Math.Abs(l - r);

            if (diff > a)
                return x + a;

            //else

            return x + diff + ((a - diff) / 2);
        }
    }
}

using System.Linq;
using System;

class Solution
{
    static void Main()
    {
        var lra = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var l = lra[0];
        var r = lra[1];
        var a = lra[2];
        if (l < r)
        {
            l += Math.Min(a, r - l);
            a -= Math.Min(a, r - l);
        }
        else if (l > r)
        {
            r += Math.Min(a, l - r);
            a -= Math.Min(a, l - r);
        }
        r += a / 2;
        l += a / 2;
        Console.WriteLine(2 * Math.Min(l, r));
    }
}

using System;

namespace Left_handers__Right_handers_and_Ambidexters
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int l = int.Parse(input.Split(' ')[0]);
            int r = int.Parse(input.Split(' ')[1]);
            int a = int.Parse(input.Split(' ')[2]);

            if (l < r)
            {
                int temp = r - 1;
                if (temp > a)
                {
                    l += a;
                    temp = r - l;
                    Console.WriteLine((l+r)-temp);
                }
                else
                {
                    l += temp;
                    a -= temp;
                    l += a / 2;
                    r += a / 2;
                    Console.WriteLine(l+r);
                }
            }
            else if (l > r)
            {
                int temp = l - r;
                if (temp > a)
                {
                    r += a;
                    temp = l - r;
                    Console.WriteLine((l + r) - temp);
                }
                else
                {
                    r += temp;
                    a -= temp;
                    l += a / 2;
                    r += a / 2;
                    Console.WriteLine(l + r);
                }
            }
            else
            {
                l += a / 2;
                r += a / 2;
                Console.WriteLine(l+r);
            }
        }
    }
}

using System;

namespace Left_handers__Right_handers_and_Ambidexters
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int l = int.Parse(input.Split(' ')[0]);
            int r = int.Parse(input.Split(' ')[1]);
            int a = int.Parse(input.Split(' ')[2]);

            if (l < r)
            {
                int temp = r - 1;
                if (temp > a)
                {
                    l += a;
                    temp = r - l;
                    Console.WriteLine((l+r)-temp);
                }
                else
                {
                    l += temp;
                    a -= temp;
                    l += a / 2;
                    r += a / 2;
                    Console.WriteLine(l+r);
                }
            }
            else if (l > r)
            {
                int temp = l - 1;
                if (temp > a)
                {
                    r += a;
                    temp = l - r;
                    Console.WriteLine((l + r) - temp);
                }
                else
                {
                    r += temp;
                    a -= temp;
                    l += a / 2;
                    r += a / 2;
                    Console.WriteLine(l + r);
                }
            }
            else
            {
                l += a / 2;
                r += a / 2;
                Console.WriteLine(l+r);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int l, r, a;
            var split = Console.ReadLine().Split();

            l = int.Parse(split[0]);
            r = int.Parse(split[1]);
            a = int.Parse(split[2]);

            int max = Math.Max(l, r);
            int min = Math.Min(l, r);

            int raz = max - min;

            if (raz >= a)
                Console.WriteLine((min + a) * 2);
            else if (raz < a)
            {
                a = a % 2 == 0 ? a : a - 1;
                Console.WriteLine(max * 2 + a - raz);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int l, r, a;
            var split = Console.ReadLine().Split();
            l = int.Parse(split[0]);
            r = int.Parse(split[1]);
            a = int.Parse(split[2]);
            int sum;

            sum = l + r + a;

            if (sum < 3)
                Console.WriteLine(0);
            if (sum >= 3)
                Console.WriteLine(sum - 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bowling
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int leftHand = int.Parse(tokens[0]);
            int rightHand = int.Parse(tokens[1]);
            int ambidexters = int.Parse(tokens[2]);

            Console.WriteLine(maxGroupCount(leftHand, rightHand, ambidexters));
            //Console.ReadKey();
        }

        public static int maxGroupCount(int leftHand, int rightHand,int ambidexters) {

           // leftHand += ambidexters;
            if (rightHand < leftHand) {
                int temp = rightHand;
                rightHand = leftHand;
                leftHand = temp;
            }

            if (leftHand == 0) return 0;
            else {
                int difference = rightHand - leftHand;
                if (difference == 0) return  2 * leftHand + 2 * (ambidexters / 2);
                else {

                    if ((leftHand + ambidexters) <= rightHand) return 2 * (leftHand + ambidexters);
                    else {
                        leftHand += difference; ambidexters -= difference;
                        return  2 * leftHand + 2 * (ambidexters / 2);
                      }

                }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bowling
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int leftHand = int.Parse(tokens[0]);
            int rightHand = int.Parse(tokens[1]);
            int ambidexters = int.Parse(tokens[2]);

            Console.WriteLine(maxGroupCount(leftHand, rightHand, ambidexters));

        }

        public static int maxGroupCount(int leftHand, int rightHand,int ambidexters) {

            leftHand += ambidexters;
            if (rightHand < leftHand) {
                int temp = rightHand;
                rightHand = leftHand;
                leftHand = temp;
            }

            if (leftHand == 0) return 0;
            else {
                int difference = rightHand - leftHand;
                if (difference == 0) return rightHand + leftHand;
                else {
                       rightHand -= difference;
                       return rightHand + leftHand + 2 * (difference / 2);
                }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), s => (int.Parse(s)));
            int l = arr[0];
            int r = arr[1];
            int both = arr[2];

            bool flag = true;
            bool check = true;
            while (both > 0)
            {
                flag = false;
                if (l == r && both == 1)
                {
                    if ((l + r) % 2 == 0)
                    {
                        Console.WriteLine(l + r);
                    }
                    else
                    {
                        Console.WriteLine((l + r) - 1);
                    }
                    check = false;
                    break;

                }
                else
                {
                    if (l == r && both > 0)
                    {
                        l++;
                        both--;
                    }
                    else if (l > r && both > 0)
                    {
                        r++;
                        both--;
                    }
                    else if (r > l && both > 0)
                    {
                        l++;
                        both--;
                    }
                }
            }
            if (check)
            {
                if (flag)
                {
                    if (l != r)
                    {
                        Console.WriteLine(0);
                    }
                }
                else
                {
                    if ((l + r) % 2 == 0)
                    {
                        Console.WriteLine(l + r);
                    }
                    else
                    {
                        Console.WriteLine((l + r) - 1);
                    }
                }
                //Console.ReadLine();
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), s => (int.Parse(s)));
            int l = arr[0];
            int r = arr[1];
            int both = arr[2];

            bool flag = true;
            bool check = true;
            while (both > 0)
            {
                flag = false;
                if (l == r && both == 1)
                {
                    if ((l + r) % 2 == 0)
                    {
                        Console.WriteLine(l + r);
                    }
                    else
                    {
                        Console.WriteLine((l + r) - 1);
                    }
                    check = false;
                    break;

                }
                else
                {
                    if (l == r && both > 0)
                    {
                        l++;
                        both--;
                    }
                    else if (l > r && both > 0)
                    {
                        r++;
                        both--;
                    }
                    else if (r > l && both > 0)
                    {
                        l++;
                        both--;
                    }
                }
            }
            if (check)
            {
                if (flag)
                {
                    if (l != r)
                    {
                        Console.WriteLine(0);
                    }
                    else
                    {
                        Console.WriteLine(Math.Min(l,r)*2);
                    }
                }
                else
                {
                    if ((l + r) % 2 == 0)
                    {

                        Console.WriteLine(Math.Min(l, r) * 2);
                    }
                    else
                    {
                        int ans = Math.Min(l, r) * 2;

                        Console.WriteLine(ans--);
                    }
                }
                //Console.ReadLine();
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), s => (int.Parse(s)));
            int l = arr[0];
            int r = arr[1];
            int both = arr[2];

            bool flag = true;
            bool check = true;
            while (both > 0)
            {
                flag = false;
                if (l == r && both == 1)
                {
                    if ((l + r) % 2 == 0)
                    {
                        Console.WriteLine(l + r);
                    }
                    else
                    {
                        Console.WriteLine((l + r) - 1);
                    }
                    check = false;
                    break;

                }
                else
                {
                    if (l == r && both > 0)
                    {
                        l++;
                        both--;
                    }
                    else if (l > r && both > 0)
                    {
                        r++;
                        both--;
                    }
                    else if (r > l && both > 0)
                    {
                        l++;
                        both--;
                    }
                }
            }
            if (check)
            {
                if (flag)
                {
                    if (l != r)
                    {
                        Console.WriteLine(0);
                    }
                    else
                    {
                        Console.WriteLine(l-r);
                    }
                }
                else
                {
                    if ((l + r) % 2 == 0)
                    {

                        Console.WriteLine(Math.Min(l, r) * 2);
                    }
                    else
                    {
                        int ans = Math.Min(l, r) * 2;

                        Console.WriteLine(ans--);
                    }
                }
              //  Console.ReadLine();
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), s => (int.Parse(s)));
            int l = arr[0];
            int r = arr[1];
            int both = arr[2];

            bool flag = true;
            while (both > 0)
            {
                flag = false;
                if (l == r && both == 1)
                {
                    if ((l + r) % 2 == 0)
                    {
                        Console.WriteLine(l + r);
                    }
                    else
                    {
                        Console.WriteLine((l + r) - 1);
                    }
                    break;

                }
                else
                {
                    if (l == r && both > 0)
                    {
                        l++;
                        both--;
                    }
                    else if (l > r && both > 0)
                    {
                        r++;
                        both--;
                    }
                    else if (r > l && both > 0)
                    {
                        l++;
                        both--;
                    }
                }
            }
            if (flag)
            {
                if (l != r)
                {
                    Console.WriteLine(0);
                }
            }
            else
            {
                if ((l + r) % 2 == 0)
                {
                    Console.WriteLine(l + r);
                }
                else
                {
                    Console.WriteLine((l + r) - 1);
                }
            }
            //Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), s => (int.Parse(s)));
            int l = arr[0];
            int r = arr[1];
            int both = arr[2];

            bool flag = true;
            bool check = true;
            while (both > 0)
            {
                flag = false;
                if (l == r && both == 1)
                {
                    if ((l + r) % 2 == 0)
                    {
                        Console.WriteLine(l + r);
                    }
                    else
                    {
                        Console.WriteLine((l + r) - 1);
                    }
                    check = false;
                    break;

                }
                else
                {
                    if (l == r && both > 0)
                    {
                        l++;
                        both--;
                    }
                    else if (l > r && both > 0)
                    {
                        r++;
                        both--;
                    }
                    else if (r > l && both > 0)
                    {
                        l++;
                        both--;
                    }
                }
            }
            if (check)
            {
                if (flag)
                {
                    if (l != r)
                    {
                        Console.WriteLine(0);
                    }
                }
                else
                {
                    if ((l + r) % 2 == 0)
                    {

                        Console.WriteLine(Math.Min(l, r) * 2);
                    }
                    else
                    {
                        int ans = Math.Min(l, r) * 2;

                        Console.WriteLine(ans--);
                    }
                }
                //Console.ReadLine();
            }
        }
    }
}

//ReSharper disable All
using System;

namespace ConsoleApp1
{
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;

    public class Program
    {
        public static void Main(string[] args)
        {
            int[] k = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int l = k[0], r = k[1], a = k[2];
            int res = 0;

            for (int i = 0; i <= a; i++)
            {
                if (a == 0)
                {
                    break;
                }
                if (l > r)
                {
                    a--;
                    r++;
                }
                else if (l < r)
                {
                    a--;
                    l++;
                }
                else if (l == r)
                {
                    a--;
                    if (i % 2 == 0)
                    {
                        r++;
                    }
                    else
                    {
                        l++;
                    }
                }
            }

            Console.WriteLine((r+l+a)-Math.Abs(r-l));
        }
    }

}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
public class CodeForces
{
#if TEST
    // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.
    const bool testing = true;
#else
const bool testing = false;
#endif

    static void program(TextReader input)
    {
       // var n = int.Parse(input.ReadLine());
        var data = input.ReadLine().Split(' ').Select(int.Parse).ToList();
        var l = data[0];
        var r = data[1];
        var a = data[2];
        var i = 200;
        for (; i > 0; i-=2)
        {
            var left = i / 2;
            var right = left;
            left -= l;
            right -= r;
            var need = 0;
            need = Math.Max(0, left) + Math.Max(0, right);
            if(need <= a)
            {
                break;
            }
        }

        Console.WriteLine(i);
    }

    public static void Main(string[] args)
    {
        if (!testing)
        { // set testing to false when submiting to codeforces
            program(Console.In); // write your program in 'program' function (its your new main !)
            return;
        }

        Console.WriteLine("Test Case(1) => expected :");
        Console.WriteLine("6\n");
        Console.WriteLine("Test Case(1) => found    :");
        program(new StringReader("1 4 2\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(2) => expected :");
        Console.WriteLine("14\n");
        Console.WriteLine("Test Case(2) => found    :");
        program(new StringReader("5 5 5\n"));
        Console.WriteLine();

        Console.WriteLine("Test Case(3) => expected :");
        Console.WriteLine("0\n");
        Console.WriteLine("Test Case(3) => found    :");
        program(new StringReader("0 2 0\n"));
        Console.WriteLine();

    }
}

using System;

class Program
{
    static void Main()
    {
        string[] temp_d = Console.ReadLine().Split(' ');
        int l, r, a,max,min,res;
        l = int.Parse(temp_d[0]);
        r = int.Parse(temp_d[1]);
        a = int.Parse(temp_d[2]);
        if (l > r)
        {
            max = l; min = r;
        }
        else
        {
            max = r; min = l;
        }
        res = (max -(max-min))*2;
        max -= min;
        if (max > a)
        {
            res += (max -( max- a))*2;
            a = 0;
        }
        else if (max!=0)
        {
            res += ((a-max) - max)*2;
            a -= max;
        }
        res += (a / 2)*2;
        Console.WriteLine(res);
        Console.ReadLine();
    }
}