using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
//using Edge = Pair<long, int>;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static void Solve()
    {
        var rgb = Input.arL;
        Array.Sort(rgb);
        var sum = rgb.Sum() / 3;
        if (rgb[2] >= 2 * (rgb[0] + rgb[1]))
            WriteLine(rgb[0] + rgb[1]);
        else WriteLine(sum);
    }
}

public class Input
{
    public static string read => ReadLine().Trim();
    public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();
    public  static int num => ToInt32(read);
    public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h)
        => Enumerable.Repeat(0, h).Select(_ => read.ToCharArray()).ToArray();
    public static int[] ar1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => num).ToArray();
    public static long[] arL1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => numL).ToArray();
    public static string[] strs(int n)
        => Enumerable.Repeat(0, n).Select(_ => read).ToArray();
    public static int[][] ar2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => ar).ToArray();
    public static long[][] arL2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => arL).ToArray();
    public static T getValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}

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

namespace ReadTemplate
{
    public class Solver
    {
        public static void Solve()
        {
            long ans = 0;
            var a = ReadLongArray();
            Array.Sort(a);
            while (a[1] > 0 && a.Sum() >= 3)
            {
                long d = a[2] - a[1];
                if (d > 1)
                {
                    long b = a[1] - a[0];
                    long c = Math.Min(d / 2, b);
                    ans += c;
                    a[2] -= 2 * c;
                    a[1] -= c;

                    if (a[0] == a[1])
                    {
                        d = a[2] - a[1];
                        if (d > 1)
                        {
                            c = Math.Min(d / 2, 2 * a[0]);
                            ans += c;
                            a[0] -= c / 2;
                            a[1] -= (c + 1) / 2;
                            a[2] -= 2 * c;
                        }
                        Array.Sort(a);
                    }
                }
                else
                {
                    ans += a.Sum() / 3;
                    break;
                }
            }
            Console.WriteLine(ans);
        }

        public static void Main()
        {
            Reader = Console.In; Writer = Console.Out;
            //Reader = File.OpenText("input.txt"); Writer = File.CreateText("output.txt");

            Solve();

            Reader.Close();
            Writer.Close();
        }

        #region Read/Write

        private static TextReader Reader;

        private static TextWriter Writer;

        private static Queue<string> CurrentLineTokens = new Queue<string>();

        private static string[] ReadAndSplitLine()
        {
            return Reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        public static string ReadToken()
        {
            while (CurrentLineTokens.Count == 0)
                CurrentLineTokens = new Queue<string>(ReadAndSplitLine());
            return CurrentLineTokens.Dequeue();
        }

        public static int ReadInt()
        {
            return int.Parse(ReadToken());
        }

        public static long ReadLong()
        {
            return long.Parse(ReadToken());
        }

        public static double ReadDouble()
        {
            return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
        }

        public static int[] ReadIntArray()
        {
            return ReadAndSplitLine().Select(int.Parse).ToArray();
        }

        public static long[] ReadLongArray()
        {
            return ReadAndSplitLine().Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
        }

        public static int[][] ReadIntMatrix(int numberOfRows)
        {
            int[][] matrix = new int[numberOfRows][];
            for (int i = 0; i < numberOfRows; i++)
                matrix[i] = ReadIntArray();
            return matrix;
        }

        public static string[] ReadLines(int quantity)
        {
            string[] lines = new string[quantity];
            for (int i = 0; i < quantity; i++)
                lines[i] = Reader.ReadLine().Trim();
            return lines;
        }

        public static void WriteArray<T>(IEnumerable<T> array)
        {
            Writer.WriteLine(string.Join(" ", array));
        }

        #endregion
    }
}

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

namespace CF {
    class Program {
        static long[] a;

        static void solve()
        {
            a = Array.ConvertAll(Console.ReadLine().Split(), ts => long.Parse(ts));
            Array.Sort(a);
            if (a[0] + a[1] < a[2]/2)
            {
                Console.Write(a[0] + a[1]);
            } else
            {
                Console.Write((a[0] + a[1] + a[2]) / 3);
            }
        }

        static void Main( string[ ] args ) {
            //Console.SetIn(new StreamReader("in.txt"));

            solve( );
        }
    }
}

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

namespace codeforces
{
	class Program
	{
		public const int Osn = 1000000007;

		public class Pair
		{
			public int First;

			public int Second;
		}

		public class PairComparer : IComparer<Pair>
		{
			public int Compare(Pair x, Pair y)
			{
				if (x.First > y.First || (x.First == y.First && x.Second < y.Second))
					return -1;
				return 1;
			}
		}

		public static long GetGcd(long a, long b)
		{
			while (true)
			{
				if (b == 0)
					return a;
				var a1 = a;
				a = b;
				b = a1 % b;
			}
		}

		public static void WriteYesNo(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string ReadString()
		{
			return Console.ReadLine();
		}

		public static List<int> ReadListOfInts()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static List<long> ReadListOfLongs()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(long.Parse).ToList();
		}

		public static int ReadInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static long ReadLong()
		{
			var s = Console.ReadLine();
			return long.Parse(s);
		}

		public class Vertex
		{
			public int Was;

			public List<Pair> Edges;
		}

		public static List<List<Vertex>> Graph = new List<List<Vertex>>();

		public static bool Dfs(int x, int y, int prevx, int prevy)
		{
			Graph[x][y].Was = 1;
			var result = false;
			foreach (var t in Graph[x][y].Edges)
			{
				if (Graph[t.First][t.Second].Was == 0)
					result |= Dfs(t.First, t.Second, x, y);
				else if (t.First != prevx || t.Second != prevy)
					return true;
			}

			return result;
		}

		private static void Main()
		{
			var l = ReadListOfLongs();
			l.Sort();
			l[2] = Math.Min(l[2], 2 * (l[0] + l[1]));
			Console.WriteLine(l.Sum() / 3);
			Console.ReadLine();
		}
	}
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static long max(long a, long b, long c)
        {
            if (a > b && a > c)
                return a;
            if (b > c)
                return b;
            return c;
        }
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            long a=0, b=0, c=0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == ' ')
                {
                    a = long.Parse(s.Substring(0, i));
                    s = s.Substring(i + 1);
                    break;
                }
            }
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == ' ')
                {
                    b = long.Parse(s.Substring(0, i));
                    c = long.Parse(s.Substring(i + 1));
                    break;
                }
            }
            long t=0;
            long max1 = max(a, b, c);
            long temp = max1 / 2;
            if (max1 % 2 == 1)
            {
                if (a + b + c - max1 >= temp + 2)
                {
                    temp = (a + b + c) / 3;
                    Console.Write(temp);
                }
                else
                {
                    if (a + b + c - max1 < temp + 1)
                    {
                        temp = a + b + c - max1;
                        Console.Write(temp);
                    }
                    else
                    {
                        temp = a + b + c - max1;
                        temp--;
                        Console.Write(temp);
                    }
                }
            }
            else
            {
                if (a + b + c - max1 >= temp)
                {
                    temp = (a + b + c) / 3;
                    Console.Write(temp);
                }
                else
                {
                    temp = a + b + c - max1;
                    Console.Write(temp);
                }
            }
        }
    }
}

using System;

public class Test
{
	static long caseType = -1;
		static long maxNum = -1;
		static long secondMaxNum = -1;
		static long minNum = -1;
		static long sameNumber = -1;
		static long diffNumber = -1;
		static long answer = 0;
		public static void Main()
		{
			var numbers = Console.ReadLine().Split(' ');
			var r = long.Parse(numbers[0]);
			var g = long.Parse(numbers[1]);
			var b = long.Parse(numbers[2]);

			DetermineCase(r, g, b);
			Casehandler(r, g, b);

			Console.Write(answer);

		}

		static void Casehandler(long r, long g, long b) {
			if (caseType == 1)
			{
				if (minNum != 0)
				{
					long x = (maxNum - secondMaxNum + (2 * minNum))/4;
					var y = minNum - x;
					if (y < 0) {
						x = minNum; y = 0;
					}
					long z = 0;
					if (y > x) {
						z = y;
						y = x;
						x = z;
					}
					answer += minNum;

					var newr = maxNum - (2 * x);
					var newg = secondMaxNum - (2 * y);
					var newb = 0;
					DetermineCase(newr, newg, newb);
					Casehandler(newr, newg, newb);
				}
				else {
					var x = maxNum - secondMaxNum;
					if (x > secondMaxNum) {
						x = secondMaxNum;
					}
					answer += x;
					var newr = maxNum - (2 * x);
					var newg = secondMaxNum - x;
					var newb = 0;
					DetermineCase(newr, newg, newb);
					Casehandler(newr, newg, newb);
				}

			}
			else if (caseType == 2)
			{
				if (r == 0 && g == 0 && b == 0)
				{
					return;
				}
				answer += r;
				return;
			}
			else if (caseType == 3)
			{
				if (sameNumber == 0 || sameNumber == 1) {
					return;
				}

				var x = (sameNumber - diffNumber) / 3;

				answer += (2 * x);
				var newr = sameNumber - (3 * x);
				var newg = newr;
				var newb = diffNumber;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 4)
			{
				if (sameNumber == 0 || sameNumber == 1)
				{
					return;
				}

				if (sameNumber == 2) {
					answer += 1;
					return;
				}

				answer += (diffNumber);
				DetermineCase(sameNumber - diffNumber, sameNumber - diffNumber, 0);
				Casehandler(sameNumber - diffNumber, sameNumber - diffNumber, 0);
			}
			else if (caseType == 5)
			{
				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}
				answer += (sameNumber);
				DetermineCase(diffNumber - sameNumber, 0, 0);
				Casehandler(diffNumber - sameNumber, 0, 0);
			}
			else if (caseType == 6) {

				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}

				var x = (diffNumber - sameNumber)/3;

				if (x > sameNumber) {
					x = sameNumber;
				}

				answer += (2 * x);
				var newr = diffNumber - (4 * x);
				var newg = sameNumber -  x;
				var newb = sameNumber - x;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}

		}

		static void DetermineCase(long r, long g, long b) {
			if (r != g && g != b && b != r)
			{
				caseType = 1; //all different
				maxNum = Math.Max(r, Math.Max(g, b));
				if (maxNum == r) {
					secondMaxNum = Math.Max(g, b);
					minNum = secondMaxNum == g ? b : g;
				} else if (maxNum == g)
				{
					secondMaxNum = Math.Max(r, b);
					minNum = secondMaxNum == r ? b : r;
				} else
				{
					secondMaxNum = Math.Max(g, r);
					minNum = secondMaxNum == g ? r : g;
				}
			}
			else if (r == g && g == b && b == r)
			{
				caseType = 2; //all same
			}
			else
			{
				if (r == g)
				{
					sameNumber = r;
					diffNumber = b;
				}
				else if (g == b)
				{
					sameNumber = g;
					diffNumber = r;
				}
				else if (r == b)
				{
					sameNumber = b;
					diffNumber = g;
				}

				if (sameNumber - diffNumber > 2)
				{
					caseType = 3; //58 58 40
				}
				else if (sameNumber - diffNumber == 1 || sameNumber - diffNumber == 2) {
					caseType = 4; //58 58 57
				}
				else if (diffNumber - sameNumber < 3)
				{
					caseType = 5; //28 26 26
				}
				else
				{
					caseType = 6; //30 27 27
				}
			}
		}

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
//using Microsoft.CSharp;

using System.Numerics;

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            BigInteger gr = BigInteger.Parse(tokens[0]);

            BigInteger bl = BigInteger.Parse(tokens[1]);

            BigInteger re = BigInteger.Parse(tokens[2]);

             //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            BigInteger sum = 0;
                sum=(re + bl+gr );

            //Console.WriteLine(" here el sum  " + sum);
            BigInteger temp = (sum / 3);

            //
         // Console.WriteLine(" here el temmp  " + temp);
            // get the max
            BigInteger max = gr;
            if (gr <= bl && bl >= re)
                max = bl;
            else if (gr <= re && re >= bl)
                max = re;

            BigInteger temp1 = (sum -max );
            if (temp < temp1)
                Console.WriteLine( temp);
            else
                Console.WriteLine(temp1);
            // Console.ReadKey();

        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using Solver.Ex;
using Watch = System.Diagnostics.Stopwatch;
using StringBuilder = System.Text.StringBuilder;
namespace Solver
{

    public class Solver
    {
        public void Solve()
        {
            var a = sc.Long(3).OrderBy(x => x).ToArray();
            var sum = a.Sum();
            if ((a[0] + a[1]) * 2 < a[2])
                IO.Printer.Out.PrintLine(a[0] + a[1]);
            else
                IO.Printer.Out.PrintLine(sum / 3);
        }
        internal IO.StreamScanner sc;
    }

    #region Main and Settings
    static class Program
    {
        static void Main(string[] arg)
        {
#if DEBUG
            var errStream = new System.IO.FileStream(@"..\..\dbg.out", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
            System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, "debugStream"));
            System.Diagnostics.Debug.AutoFlush = false;
            var sw = new Watch();
            sw.Start();
            try
            {
#endif
                var solver = new Solver();
                solver.sc = new IO.StreamScanner(Console.OpenStandardInput());
                IO.Printer.Out = new IO.Printer(new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
                solver.Solve();
                IO.Printer.Out.Flush();
#if DEBUG
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                Console.Error.WriteLine(ex.StackTrace);
            }
            finally
            {
                sw.Stop();
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Error.WriteLine("Time:{0}ms", sw.ElapsedMilliseconds);
                System.Diagnostics.Debug.Close();
                System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            }
#endif
        }

    }
    #endregion
}
#region IO Helper
namespace Solver.IO
{
    public class Printer
    {
        static Printer()
        {
            Out = new Printer(Console.Out);
        }
        public static Printer Out { get; set; }
        private readonly System.IO.TextWriter writer;
        private readonly System.Globalization.CultureInfo info;
        public string Separator { get; set; }
        public string NewLine { get { return writer.NewLine; } set { writer.NewLine = value ?? "\n"; } }
        public Printer(System.IO.TextWriter tw = null, System.Globalization.CultureInfo ci = null, string separator = null, string newLine = null)
        {
            writer = tw ?? System.IO.TextWriter.Null;
            info = ci ?? System.Globalization.CultureInfo.InvariantCulture;
            NewLine = newLine;
            Separator = separator ?? " ";
        }
        public void Print(int num) { writer.Write(num.ToString(info)); }
        public void Print(int num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(long num) { writer.Write(num.ToString(info)); }
        public void Print(long num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(double num) { writer.Write(num.ToString("F12", info)); }
        public void Print(double num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(string str) { writer.Write(str); }
        public void Print(string format, params object[] arg) { writer.Write(string.Format(info, format, arg)); }
        public void Print<T>(string format, IEnumerable<T> sources) { writer.Write(format, sources.OfType<object>().ToArray()); }
        public void Print(IEnumerable<char> sources) { writer.Write(sources.AsString()); }
        public void Print<T>(IEnumerable<T> sources)
        {
            var res = new System.Text.StringBuilder();
            foreach (var x in sources)
            {
                res.AppendFormat(info, "{0}", x);
                if (string.IsNullOrEmpty(Separator))
                    res.Append(Separator);
            }
            writer.Write(res.ToString(0, res.Length - Separator.Length));
        }
        public void PrintLine() { writer.WriteLine(); }
        public void PrintLine(int num) { writer.WriteLine(num.ToString(info)); }
        public void PrintLine(int num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(long num) { writer.WriteLine(num.ToString(info)); }
        public void PrintLine(long num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(double num) { writer.WriteLine(num.ToString("F12", info)); }
        public void PrintLine(double num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(string str) { writer.WriteLine(str); }
        public void PrintLine(string format, params object[] arg) { writer.WriteLine(string.Format(info, format, arg)); }
        public void PrintLine<T>(string format, IEnumerable<T> sources) { writer.WriteLine(format, sources.OfType<object>().ToArray()); }
        public void PrintLine<T>(IEnumerable<T> sources)
        {
            var res = new StringBuilder();
            foreach (var x in sources)
            {
                res.AppendFormat(info, "{0}", x);
                if (!string.IsNullOrEmpty(Separator))
                    res.Append(Separator);
            }
            writer.WriteLine(res.ToString(0, res.Length - Separator.Length));
        }
        public void Flush() { writer.Flush(); }
    }
    public class StreamScanner
    {
        public StreamScanner(System.IO.Stream stream)
        {
            iStream = stream;
        }
        private readonly System.IO.Stream iStream;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        private bool eof = false;
        public bool EndOfStream { get { return eof; } }
        private byte readByte()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            if (ptr >= len)
            {
                ptr = 0;
                len = iStream.Read(buf, 0, 1024);
                if (len <= 0)
                {
                    eof = true;
                    return 0;
                }
            }
            return buf[ptr++];
        }
        private bool inSpan(byte c)
        {
            const byte lb = 33, ub = 126;
            return !(c >= lb && c <= ub);
        }
        private byte skip()
        {
            byte b = 0;
            do b = readByte();
            while (!eof && inSpan(b));
            return b;
        }
        public char Char()
        {
            return (char)skip();
        }
        public char[] Char(int n)
        {
            var a = new char[n];
            for (int i = 0; i < n; i++)
                a[i] = (char)skip();
            return a;
        }
        public char[][] Char(int n, int m)
        {
            var a = new char[n][];
            for (int i = 0; i < n; i++)
                a[i] = Char(m);
            return a;
        }
        public string Scan()
        {

            const byte lb = 33, ub = 126;
            if (eof) throw new System.IO.EndOfStreamException();

            do
            {
                while (ptr < len && (buf[ptr] < lb || ub < buf[ptr]))
                {
                    ptr++;
                }
                if (ptr < len)
                    break;
                ptr = 0;
                len = iStream.Read(buf, 0, 1024);
                if (len <= 0)
                {
                    eof = true;
                    return null;
                }
                continue;
            } while (true);

            StringBuilder sb = null;
            do
            {
                var i = ptr;
                while (i < len)
                {
                    if (buf[i] < lb || ub < buf[i])
                    {
                        string s;
                        if (sb != null)
                        {
                            sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                            s = sb.ToString();
                        }
                        else s = new string(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                        ptr = i + 1;
                        return s;
                    }
                    i++;
                }
                i = len - ptr;
                if (sb == null) sb = new StringBuilder(i + 32);
                sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i));
                ptr = 0;
            } while ((len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true;
            return sb.ToString();
        }
        public string[] Scan(int n)
        {
            var a = new string[n];
            for (int i = 0; i < n; i++)
                a[i] = Scan();
            return a;
        }
        public string ScanLine()
        {
            const byte el = 10, cr = 13;
            if (eof) throw new System.IO.EndOfStreamException();
            StringBuilder sb = null;
            do
            {
                var i = ptr;
                while (i < len)
                {
                    if (buf[i] == cr || buf[i] == el)
                    {
                        string s;
                        if (sb != null)
                        {
                            sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                            s = sb.ToString();
                        }
                        else s = new string(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                        if (buf[i] == cr) i++;
                        if (buf[i] == el) i++;
                        ptr = i;
                        return s;
                    }
                    i++;
                }
                i = len - ptr;
                if (sb == null) sb = new StringBuilder(i + 32);
                sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i));
                ptr = 0;
            } while ((len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true;
            return sb.ToString();
        }
        public double Double()
        {
            return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture);
        }
        public double[] Double(int n)
        {
            var a = new double[n];
            for (int i = 0; i < n; i++)
                a[i] = Double();
            return a;
        }
        public int Integer()
        {
            var ret = 0;
            byte b = 0;
            bool isMynus = false;
            const byte zero = 48, nine = 57, mynus = 45;
            do b = readByte();
            while (!eof && !((b >= zero && b <= nine) || b == mynus));

            if (b == mynus)
            {
                isMynus = true;
                b = readByte();
            }
            while (true)
            {
                if (b >= zero && b <= nine)
                {
                    ret = ret * 10 + b - zero;
                }
                else return isMynus ? -ret : ret;
                b = readByte();
            }

        }
        public int[] Integer(int n)
        {
            var a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = Integer();
            return a;
        }
        public long Long()
        {
            long ret = 0;
            byte b = 0;
            bool isMynus = false;
            const byte zero = 48, nine = 57, mynus = 45;
            do b = readByte();
            while (!eof && !((b >= zero && b <= nine) || b == mynus));
            if (b == '-')
            {
                isMynus = true;
                b = readByte();
            }
            while (true)
            {
                if (b >= zero && b <= nine)
                    ret = ret * 10 + (b - zero);
                else return isMynus ? -ret : ret;
                b = readByte();
            }

        }
        public long[] Long(int n)
        {
            var a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = Long();
            return a;
        }
        public void Flush()
        {
            iStream.Flush();
        }

    }

}
#endregion
#region Extension
namespace Solver.Ex
{
    static public partial class EnumerableEx
    {
        static public string AsString(this IEnumerable<char> source)
        {
            return new string(source.ToArray());
        }
        static public string AsJoinedString<T>(this IEnumerable<T> source, string separator = " ")
        {
            return string.Join(separator, source);
        }
        static public T[] Enumerate<T>(this int n, Func<int, T> selector)
        {
            var res = new T[n];
            for (int i = 0; i < n; i++)
                res[i] = selector(i);
            return res;
        }
    }
}
#endregion

using System;

namespace R_C_273
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            long r = long.Parse(s[0]), g = long.Parse(s[1]), b = long.Parse(s[2]);
            long sum = (r + g + b) / 3;
            sum = Math.Min(sum, r + g);
            sum = Math.Min(sum, r + b);
            sum = Math.Min(sum, g + b);
            Console.WriteLine(sum);
            Console.ReadLine();
        }
    }
}

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

namespace Table_Decorations
{
    class Program
    {
        static void Main(string[] args)
        {
            string str_Inputs = Console.ReadLine();
            string[] arr_Inputs = str_Inputs.Split(' ');

            long[] arr_ballons = new long[3];
            arr_ballons[0] = Convert.ToInt64(arr_Inputs[0]);
            arr_ballons[1] = Convert.ToInt64(arr_Inputs[1]);
            arr_ballons[2] = Convert.ToInt64(arr_Inputs[2]);
            Array.Sort(arr_ballons);

            Console.Write((arr_ballons[0] + arr_ballons[1] <= arr_ballons[2] / 2)?arr_ballons[0]+arr_ballons[1]:(arr_ballons[0]+arr_ballons[1]+arr_ballons[2])/3);
            Console.Read();

        }
    }
}

using System.Linq;

namespace codeforce
{
    class Program
    {
        class Point
        {
            public double X { get; private set; }
            public double Y { get; private set; }
            public Point(double X, double Y)
            {
                this.X = X;
                this.Y = Y;
            }
            public override bool Equals(object obj)
            {
                if (obj is Point)
                {
                    return this.X == ((Point)obj).X && this.Y == ((Point)obj).Y;
                }
                else return base.Equals(obj);
            }
            public override int GetHashCode()
            {
                return X.GetHashCode() + Y.GetHashCode();
            }
        }
        public static void Main()
        {
            System.Text.StringBuilder res = new System.Text.StringBuilder();
            var tests = 1;
            //tests = readInt();
            for (int i = 0; i < tests; ++i)
            {
                res.AppendLine(Solve());
            }

            System.Console.Out.WriteLine(res);
        }

        static string Solve()
        {
            var x = readSplitedInts(' ').ToList<long>();

            long res = 0;

            x.Sort();

            long d1 = x[2] - x[1];
            long d2 = x[1] - x[0];

            long d = System.Math.Min(d1, d2);

            res += d;

            x[2] -= d * 2;
            x[1] -= d;

            d1 = x[2] - x[1];
            d2 = x[1] - x[0];

            if (x[0] == 0 && x[1] == 0)
            {
                return res.ToString();
            }
            if (d1 > 0)
            {
                long z = d1 / 3;

                z = System.Math.Min(z, x[1]);

                res += z * 2;

                x[2] -= z * 4;
                x[1] -= z;
                x[0] -= z;
            }
            if (d2 > 0)
            {
                long z = d2 / 3 * 2 + (d2 % 3 == 2 ? 1 : 0);

                res += z;

                x[2] -= z / 2 + (z % 2 == 1 ? 2 : 0);
                x[1] -= z / 2 + (z % 2 == 1 ? 1 : 0);
            }

            res += x.Min();

            return res.ToString();

        }

        static long parseInt(string str)
        {
            int res = 0;
            for (int i = 0; i < str.Length; ++i)
            {
                res *= 10;
                switch (str[i])
                {
                    case '0':
                        res += 0;
                        break;
                    case '1':
                        res += 1;
                        break;
                    case '2':
                        res += 2;
                        break;
                    case '3':
                        res += 3;
                        break;
                    case '4':
                        res += 4;
                        break;
                    case '5':
                        res += 5;
                        break;
                    case '6':
                        res += 6;
                        break;
                    case '7':
                        res += 7;
                        break;
                    case '8':
                        res += 8;
                        break;
                    case '9':
                        res += 9;
                        break;
                }
            }
            if (str.StartsWith("-"))
            {
                res *= -1;
            }
            return res;
        }
        static long[] readSplitedInts(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            long[] res = new long[t.Length];
            for (int i = 0; i < t.Length; ++i)
            {
                res[i] = parseInt(t[i]);
            }
            return res;
        }
        static long readInt()
        {
            return parseInt(System.Console.In.ReadLine());
        }
        static string[] readSplited(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            return t;
        }
    }
}

using System;
class Program
    {
        static void Main(string[] args)
        {
            long[] vls;
            {
                string[] input = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                vls = new long[3] {long.Parse(input[0]), long.Parse(input[1]), long.Parse(input[2]) };
            }
            Array.Sort(vls);
            Console.WriteLine(vls[2] > (vls[1] + vls[0]) * 2L ? vls[1] + vls[0] : (vls[0] + vls[1] + vls[2])/3L);
        }
    }

using System;
using System.Linq;

namespace CSharp
{
    public class _478C
    {
        public static void Main()
        {
            long[] counts = Console.ReadLine().Split().Select(token => long.Parse(token)).ToArray();

            long sum = counts.Sum();
            long max = counts.Max();

            Console.WriteLine(2 * sum >= 3 * max ? sum / 3 : sum - max);
        }
    }
}

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

namespace TestProject
{
	class Program
	{
		//538A - Cutting banner
		static void Main(string[] args)
		{
			String test = null;
#if LOCALTEST
			test = "../../test.txt";
#endif
			FastReader reader = new FastReader(test);
			long result, tmp;
			long[] a = new long[3];
			for (int i = 0; i < a.Length; ++i)
			{
				a[i] = reader.nextLong();
			}

			Array.Sort(a);
			result = 0;
			if (a[2] < 2 * (a[1] + a[0]))
			{
				result += (a[0] + a[1] + a[2]) / 3;
			}
			else
			{
				result += a[0] + a[1];
			}

			//result = a[0];

			//a[1] -= a[0];
			//a[2] -= a[0];
			//a[0] -= a[0];

			//tmp = Math.Min(a[1], a[2] - a[1]);
			//tmp = Math.Min(tmp, a[2] / 2);
			//result += tmp;

			//a[1] -= tmp;
			//a[2] -= 2 * tmp;

			//if (a[1] > 0 && a[2] > 0)
			//{
			//	result += (a[1] + a[2]) / 3;
			//}

			Console.Write(result);

#if LOCALTEST
			Console.ReadLine();
#endif
		}
	}

	class FastReader
	{
		private TextReader reader = null;
		private Queue<String> q = null;

		public FastReader(String fileName)
		{
			try
			{
				if (fileName != null)
				{
					reader = new StreamReader(fileName);
				}
				else
				{
					reader = System.Console.In;
				}
			}
			catch (FileNotFoundException e)
			{
				throw e;
			}
		}

		public FastReader()
		{
			reader = System.Console.In;
		}

		public String next() {
			while (q == null || q.Count == 0)
			{
				q = new Queue<string>(reader.ReadLine().Split());
			}
			return q.Dequeue();
		}

		public int nextInt()
		{
			return Int32.Parse(next());
		}

		public long nextLong()
		{
			return Int64.Parse(next());
		}

		public double nextDouble()
		{
			return Double.Parse(next());
		}
	}

}

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Array.Sort(A);

		if((A[0]+A[1])*2<=A[2]){
			Console.WriteLine((A[0]+A[1]));
			return;
		}
		if(A[1]==0&&A[0]==0){
			Console.WriteLine(0);
			return;
		}

		long cnt=0;

		long a=A[2]-A[1];
		long b=A[1]-A[0];
		long c=A[0];

		cnt=c;
		if(a>=b){
			cnt+=b;
			a-=b;
			cnt+=Math.Min(a/3,c);
			Console.WriteLine(cnt);return;
		}else{
			cnt+=a;
			cnt+=((b-a)/3)*2;
			if((b-a)%3==2)cnt++;
			Console.WriteLine(cnt);
		}

	}
	long[] A;
	public Sol(){
		A=rla();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq.Expressions;

namespace prC {

    internal class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        static readonly StreamWriter writer = new StreamWriter("output");
        static readonly StreamReader reader = new StreamReader("input");
#endif

        static void Main(string[] args) {
            long[] c = Array.ConvertAll(reader.ReadLine().Split(' '), long.Parse);
            Array.Sort(c);
            long ans = c[2] >= 2 * (c[0] + c[1]) ? c[0] + c[1] : (c[0] + c[1] + c[2]) / 3;
            writer.WriteLine(ans);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

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

namespace Table_Decorations
{
    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)
        {
            var list = new List<long>();
            list.Add(Next());
            list.Add(Next());
            list.Add(Next());

            list.Sort();

            long count = list.Sum()/3;
            if (2*count < list[2])
            {
                count = Math.Min(list[0] + list[1],count);
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static long Next()
        {
            int c;
            long 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.Globalization;
using System.IO;
using System.Linq;

// (づ°ω°)づﾐ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public object Solve()
    {
        var a = ReadLongArray();
        Array.Sort(a);
        long x = Math.Min(a[2] - a[1], a[0]);
        a[1] += x;
        a[0] -= x;

        a[1] += a[0] / 2;
        a[2] += (a[0] + 1) / 2;

        return Math.Min(a[1], (a[1] + a[2]) / 3);

        return null;
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
//        reader = new StreamReader("army.in");
//        writer = new StreamWriter("army.out");
#endif
        try
        {
            object result = new Solver().Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            Console.WriteLine(ex);
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }

    #endregion
}

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

	class contest
	{

		static void Main(string[] args)
		{
		           var num = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

            Array.Sort(num);
            long mxTable = num.Min() ;

            var cp = new long[3];
            num.CopyTo(cp, 0);
            long min = num.Min();
            long sum = num.Sum();

            num.CopyTo(cp, 0);

            if (cp[0] > 0 || cp[1] > 0)
            {
                long tmp = 0;

                while (cp[1] > 0 && cp[2] > 1)
                {
                    long red = 0;
                    //if(cp[0]>1) //(cp[0]>1 && cp[0]*2 >= cp[1])
                    //{
                    //     red = Math.Min(cp[1], Math.Min( cp[0]/2  , cp[2] / 2));

                    //}
                    //else red = Math.Min(cp[1],  cp[2] / 2);

                    if (cp[1] >= 4) red = cp[1] / 4;
                    else red = Math.Min(cp[1],cp[2]/2);

                    cp[1] -= red;
                    cp[2] -= red * 2;

                    tmp += red;
                    Array.Sort(cp);
                }

                if (cp[0] == 1 || cp[2]==3) tmp++;
                //if (sum % 2 == 1) tmp++;

                mxTable = Math.Max(mxTable, tmp);
            }

            Console.WriteLine(mxTable);

        }

	}

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

namespace lexco
{
    class Program
    {
        static void Main(string[] args)
        {//ولا يمحمة يمحروس يلا
           ulong[] input = Console.ReadLine().Split(' ').Select(x => ulong.Parse(x)).ToArray();
                Array.Sort(input);
                ulong r = input[0];
                ulong g = input[1];
                ulong b = input[2];
                ulong ans = min(min(min((r + g + b) / 3, r + g), r + b), b + g);
                Console.WriteLine(ans);

        }
        static ulong min(ulong x, ulong y)
        {
            return x > y ? y : x;
        }
    }
}

#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

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

namespace _237c
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
#if DEBUG
        static bool _useFileInput = false;
#else
        static bool _useFileInput = false;
#endif

        static void Main(string[] args)
        {
            StreamWriter file = null;
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }

#if DEBUG
			if (!_useFileInput)
			{
				Console.SetIn(getInput());
			}
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var d = readIntArray();

            var count = 0L;
            while (true)
            {
                Array.Sort(d);
                var max = d[2];
                var mid = d[1];
                var min = d[0];

                if (max > mid && mid > min)
                {
                    var can1 = mid - min;
                    var can2 = max - mid;
                    var can = Math.Min(can1, can2);

                    d[2] -= can * 2;
                    d[1] -= can;
                    count += can;
                }
                else if (max == mid && mid > min)
                {
                    var diff = max - min;
                    var can = diff / 3;

                    d[2] -= can * 3;
                    d[1] -= can * 3;
                    count += can * 2;

                    var rem = diff % 3;
                    if (rem == 0)
                    {
                        continue;
                    }

                    count += min;
                    if (rem == 2)
                    {
                        count += 1;
                    }

                    break;
                }
                else if (max == min)
                {
                    count += min;
                    break;
                }
                else if (max > mid && min == mid && mid == 0)
                {
                    break;
                }
                else if (max > mid && mid == min)
                {
                    var diff = max - mid;
                    if (diff == 1)
                    {
                        count += mid;
                        break;
                    }

                    if (diff <= 3)
                    {
                        d[2] -= 2;
                        d[1]--;
                        count++;
                        continue;
                    }

                    var can1 = (max - mid) / 3;
                    var can = Math.Min(can1, min);

                    count += can * 2;
                    d[2] -= can * 4;
                    d[1] -= can;
                    d[0] -= can;

                }
            }

            Console.WriteLine(count);

            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int readInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long readLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}

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

namespace CodeForces_273_C {
  class Program {
    static void Main(string[] args) {
      string[] astr = Console.ReadLine().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
      int[] aint = new int[astr.Length];
      int i = 0;
      foreach(string s in astr) {
        aint[i] = int.Parse(s);
        i++;
      }

      DateTime time1 = DateTime.Now;
      Array.Sort(aint);
      int k = Func1(aint);
      DateTime time2 = DateTime.Now;

      Console.WriteLine(k);
      //Console.WriteLine((time2 - time1).TotalMilliseconds);
      Console.ReadLine();
    }

    private static int Func1(int[] arr) {
      int kMax = (int)(((long)arr[0] + arr[1] + arr[2]) / 3);
      if(kMax > arr[1] + arr[2]) kMax = arr[1] + arr[2];

      int k = 0;

      int kMin2 = 2 * arr[1] - arr[2];
      if(kMin2 > arr[0]) kMin2 = arr[0];
      if(kMin2 > 0) {
        arr[0] -= kMin2;
        arr[1] -= kMin2;
        arr[2] -= kMin2;
        k += kMin2;
      }
      int kMin = arr[0];

      while(true) {
        if(arr[1] == 0 || arr[2] == 0) break;
        if((long)arr[0] + arr[1] + arr[2] < 3) break;

        int tmp = 0;
        if(arr[0] > 0) {

          if((arr[2] - arr[1] / 2) >= arr[0] * 2) {
            tmp = arr[0];
          } else {
            tmp = (arr[2] - arr[1] / 2) / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[0] -= tmp;
            arr[2] -= tmp * 2;

            Array.Sort(arr);
            continue;
          }
        } else {
          if((arr[2] - arr[1] / 2) >= arr[1] * 2) {
            tmp = arr[1];
          } else {
            tmp = (arr[2] - arr[1] / 2) / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[1] -= tmp;
            arr[2] -= tmp * 2;

            Array.Sort(arr);
            continue;
          }
        }

        arr[2] -= 2;
        if(arr[0] > 0) {
          arr[0] -= 1;
        } else {
          arr[1] -= 1;
        }

        if(arr[2] < arr[1]) {
          tmp = arr[2];
          arr[2] = arr[1];
          arr[1] = tmp;
        }

        k++;
      }

      return k;
    }
  }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var b = ReadLongArray();
        long s = b.Sum();
        writer.WriteLine(Math.Min(s / 3, s - b.Max()));
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var b = ReadLongArray().Where(d => d > 0).OrderBy(d => d).ToArray();
        var len = b.Length;
        long a = 0;
        if (len == 3)
        {
            var tmp = (b[2] + b[1] - 2 * b[0]) / 3;
            a = b[0] + Math.Min(tmp, b[1]);
        }
        else if (len == 2)
        {
            a = Math.Min((b[0] + b[1]) / 3, b[0]);
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Linq;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        long[] num = Console.ReadLine().Trim().Split().Select(x => long.Parse(x)).ToArray();
         Array.Sort(num);
         long total = num.Sum() / 3 ;
         if(2 * total < num[2]){
            total = Math.Min(num[0] + num[1] , total);
         }
        Console.WriteLine(total);
    }
}

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Array.Sort(A);

		if((A[0]+A[1])*2<=A[2]){
			Console.WriteLine((A[0]+A[1]));
			return;
		}
		if(A[1]==0&&A[0]==0){
			Console.WriteLine(0);
			return;
		}

		long cnt=0;

		long a=A[2]-A[1];
		long b=A[1]-A[0];
		long c=A[0];

		cnt=c;
		if(a>=b){
			cnt+=b;
			a-=b;
			cnt+=Math.Min(a/3,c);
			Console.WriteLine(cnt);return;
		}else{
			cnt+=a;
			cnt+=(b-a)/3;
			if((b-a)%3==2)cnt++;
			Console.WriteLine(cnt);
		}

	}
	long[] A;
	public Sol(){
		A=rla();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Array.Sort(A);

		if((A[0]+A[1])*2<=A[2]){
			Console.WriteLine((A[0]+A[1]));
			return;
		}
		if(A[1]==0&&A[0]==0){
			Console.WriteLine(0);
			return;
		}

		long cnt=0;

		long a=A[2]-A[1];
		long b=A[1]-A[0];
		long c=A[0];

		cnt=c;
		if(a>b){
			cnt+=b;
			a-=b;
			cnt+=Math.Min(a/3,c);
			Console.WriteLine(cnt);return;
		}else{
			cnt+=a;
			cnt+=(b-a)/3;
			if((b-a)%3==2)cnt++;
			Console.WriteLine(cnt);
		}

	}
	long[] A;
	public Sol(){
		A=rla();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}

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

namespace lexco
{
    class Program
    {
        static void Main(string[] args)
        {//ولا يمحمة يمحروس يلا
            int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            Array.Sort(input);
            int answer = (input[2] > 2 * (input[0] + input[1])) ? input[0] + input[1] : (input[0] + input[1] + input[2]) / 3;
            Console.WriteLine(answer);
            Console.ReadLine();
        }
    }
}

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

namespace lexco
{
    class Program
    {
        static void Main(string[] args)
        {//ولا يمحمة يمحروس يلا
           int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                Array.Sort(input);
                int r = input[0];
                int g = input[1];
                int b = input[2];
                int ans = ans = min(min(min((r + g + b) / 3, r + g), r + b), b + g); ans=min(min(min((r+g+b)/3,r+g),r+b),b+g);
                Console.WriteLine(ans);

        }
        static int min(int x, int y)
        {
            return x > y ? y : x;
        }
    }
}

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

namespace lexco
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            Array.Sort(input);
            int answer = input[0];
            input = input.Select(x => x - input[0]).ToArray();
            answer += (input[1] + input[2]) / 3;
            Console.WriteLine(answer);
            Console.ReadLine();
        }
    }
}

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

namespace lexco
{
    class Program
    {
        static void Main(string[] args)
        {//ولا يمحمة يمحروس يلا

            double[] input = Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();
            Array.Sort(input);
            double answer = (input[0] + input[1] >= input[2]) ? Math.Floor((input[0] + input[1] + input[2]) / 3) : input[1] - input[0];
            Console.WriteLine(answer);
            Console.ReadLine();

        }
    }
}

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

namespace lexco
{
    class Program
    {
        static void Main(string[] args)
        {//ولا يمحمة يمحروس يلا
            int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            Array.Sort(input);
            int answer = input[0];
            input = input.Select(x => x - input[0]).ToArray();
            answer += (input[1] < (input[1] + input[2]) / 3) ? input[1] : (input[1] + input[2]) / 3;
            Console.WriteLine(answer);
            Console.ReadLine();
        }
    }
}

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

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

          // Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
           // max = max - min;
           // av = av - min;
           // int newmax = max - av;
           // int newav = 0, reminder = 0;
           // if ((max + av) / 3 <= av && (max + av) / 3 > 0)
           // {
           //     newav = (max + av) / 3;
           //     reminder = (max + av) % 3;

           // }
           // else if ((max + av) / 3 > av && max<oldav*3)
           // {
           //     newav = (max + av) / 3;
           //     //Console.WriteLine("here in the first ");
           //     // reminder = (max + av) % 3;
           // }

           // else if ((max + av) / 3 > av && max < av * 3)
           // {
           //     newav = av;

           //    // Console.WriteLine("here in the sec ");
           // }
           // else if ((max + av) / 3 > av )
           // {
           //     newav = (max + av) / 3;

           //     //Console.WriteLine("here in the third ");
           //     // reminder = (max + av) % 3;
           // }

           // int output = min + newav;
           //// if (reminder > 3 || (max + av) / 3 > av)
           //  //   output++;

           //// Console.WriteLine(" new averaf  "+newav);
           // //Console.WriteLine(output);

            int sum = gr + bl + re;
            sum = sum / 3;

            if (sum < max)
                Console.WriteLine(sum);
            else
                Console.WriteLine(max);
            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (min < bl && bl < max)
                av = bl;
            else if (min < re && re < max)
                av = re;

//Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = 1;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

  //          Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

//             Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl!=min && min < bl && bl < max && max!=bl)
                av = bl;
            else if (re != min && min < re && re < max&& max!=re)
                av = re;
            else if(min <= bl && bl <= max)
             av = bl;
            else if (min <= re && re <= max )
                av = re;

          //  Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = 1;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

           // Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

             //Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (min < bl && bl < max && max!=bl)
                av = bl;
            else if (min < re && re < max&& max!=re)
                av = re;
            else if(min < bl && bl <= max)
             av = bl;
            else if (min < re && re <= max )
                av = re;

          //  Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = 1;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

          //  Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;

            // get the av
            int av = gr;
            if (min <= bl && bl <= re)
                av = bl;
            else if (min <= re && re <= bl)
                av = re;

            // get the max
            int max = gr;
            if (gr <= bl && bl >= re)
                max = bl;
            else if (gr <= re && re >= bl)
                max = re;

          //  Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = 1;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

          //  Console.WriteLine(reminder);
            Console.WriteLine(output);

             //Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;

            // get the av
            int av = gr;
            if (min <= bl && bl >= re)
                av = bl;
            else if (min <= re && re >= bl)
                av = re;

            // get the max
            int max = gr;
            if (gr <= bl && bl >= re)
                max = bl;
            else if (gr <= re && re >= bl)
                max = re;

            //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = 1;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

          //  Console.WriteLine(reminder);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (min <= bl && bl <= max)
                av = bl;
            else if (min <= re && re <= max)
                av = re;

//Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = 1;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

          //  Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
//using Microsoft.CSharp;

using System.Numerics;

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            BigInteger gr = BigInteger.Parse(tokens[0]);

            BigInteger bl = BigInteger.Parse(tokens[1]);

            BigInteger re = BigInteger.Parse(tokens[2]);

            // get the minmum

            BigInteger min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                BigInteger max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            BigInteger av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            BigInteger oldav = av;

             //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

            // max = max - min;
            // av = av - min;
            // int newmax = max - av;
            // int newav = 0, reminder = 0;
            // if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            // {
            //     newav = (max + av) / 3;
            //     reminder = (max + av) % 3;

            // }
            // else if ((max + av) / 3 > av && max<oldav*3)
            // {
            //     newav = (max + av) / 3;
            //     //Console.WriteLine("here in the first ");
            //     // reminder = (max + av) % 3;
            // }

            // else if ((max + av) / 3 > av && max < av * 3)
            // {
            //     newav = av;

            //    // Console.WriteLine("here in the sec ");
            // }
            // else if ((max + av) / 3 > av )
            // {
            //     newav = (max + av) / 3;

            //     //Console.WriteLine("here in the third ");
            //     // reminder = (max + av) % 3;
            // }

            // int output = min + newav;
            //// if (reminder > 3 || (max + av) / 3 > av)
            //  //   output++;

            //// Console.WriteLine(" new averaf  "+newav);
            // //Console.WriteLine(output);

            BigInteger sum = 0;
                sum=(min + av );
            sum = (sum+max);

            //Console.WriteLine(" here el sum  " + sum);
            BigInteger temp = (sum / 3);

            //Console.WriteLine(" here el temmp  " + temp);
            //            v = map(int, raw_input().split())
            //s = sum(v); print min(s/ 3,s - max(v))

            //sum = temp;
            BigInteger temp1 = (sum - max);
            if (temp < temp1)
                Console.WriteLine( temp);
            else
                Console.WriteLine(temp1);
            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

          // Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
               // Console.WriteLine("here in the if   "+newav);
            }
            else if ((max + av) / 3 > av)
            {
                newav = (max + av) / 3;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

           // Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

             //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

            // max = max - min;
            // av = av - min;
            // int newmax = max - av;
            // int newav = 0, reminder = 0;
            // if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            // {
            //     newav = (max + av) / 3;
            //     reminder = (max + av) % 3;

            // }
            // else if ((max + av) / 3 > av && max<oldav*3)
            // {
            //     newav = (max + av) / 3;
            //     //Console.WriteLine("here in the first ");
            //     // reminder = (max + av) % 3;
            // }

            // else if ((max + av) / 3 > av && max < av * 3)
            // {
            //     newav = av;

            //    // Console.WriteLine("here in the sec ");
            // }
            // else if ((max + av) / 3 > av )
            // {
            //     newav = (max + av) / 3;

            //     //Console.WriteLine("here in the third ");
            //     // reminder = (max + av) % 3;
            // }

            // int output = min + newav;
            //// if (reminder > 3 || (max + av) / 3 > av)
            //  //   output++;

            //// Console.WriteLine(" new averaf  "+newav);
            // //Console.WriteLine(output);

            long sum = 0;
                sum=(min + av );
            sum += max;
            long temp = (sum / 3);

            sum = temp;

            if (sum < max)
                Console.WriteLine(sum);
            else
                Console.WriteLine(sum-max);
             //Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;

            int av = gr;
            if (gr > bl && bl > re)
                av = bl;
            else if (gr > re && re > bl)
                av = re;

            int max = gr;
            if (gr < bl && bl > re)
                max = bl;
            else if (gr < re && re > bl)
                max = re;

            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0,reminder=0;

            if ((max + av) / 3 <= av&& (max + av) / 3>0)
            {
                newav = av;
                reminder = (max + av) % 3;
            }

            int output = min + newav;
            if (reminder > 3)
                output++;

            Console.WriteLine(output);

             //Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

         //   Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = av;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

         //   Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

       //      Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

             //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

            // max = max - min;
            // av = av - min;
            // int newmax = max - av;
            // int newav = 0, reminder = 0;
            // if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            // {
            //     newav = (max + av) / 3;
            //     reminder = (max + av) % 3;

            // }
            // else if ((max + av) / 3 > av && max<oldav*3)
            // {
            //     newav = (max + av) / 3;
            //     //Console.WriteLine("here in the first ");
            //     // reminder = (max + av) % 3;
            // }

            // else if ((max + av) / 3 > av && max < av * 3)
            // {
            //     newav = av;

            //    // Console.WriteLine("here in the sec ");
            // }
            // else if ((max + av) / 3 > av )
            // {
            //     newav = (max + av) / 3;

            //     //Console.WriteLine("here in the third ");
            //     // reminder = (max + av) % 3;
            // }

            // int output = min + newav;
            //// if (reminder > 3 || (max + av) / 3 > av)
            //  //   output++;

            //// Console.WriteLine(" new averaf  "+newav);
            // //Console.WriteLine(output);

            long sum = 0;
                sum=(min + av );
            sum += max;
            long temp = (sum / 3);

            sum = temp;

            if (sum < max)
                Console.WriteLine(sum);
            else
                Console.WriteLine(max);
           //  Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

             //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

            // max = max - min;
            // av = av - min;
            // int newmax = max - av;
            // int newav = 0, reminder = 0;
            // if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            // {
            //     newav = (max + av) / 3;
            //     reminder = (max + av) % 3;

            // }
            // else if ((max + av) / 3 > av && max<oldav*3)
            // {
            //     newav = (max + av) / 3;
            //     //Console.WriteLine("here in the first ");
            //     // reminder = (max + av) % 3;
            // }

            // else if ((max + av) / 3 > av && max < av * 3)
            // {
            //     newav = av;

            //    // Console.WriteLine("here in the sec ");
            // }
            // else if ((max + av) / 3 > av )
            // {
            //     newav = (max + av) / 3;

            //     //Console.WriteLine("here in the third ");
            //     // reminder = (max + av) % 3;
            // }

            // int output = min + newav;
            //// if (reminder > 3 || (max + av) / 3 > av)
            //  //   output++;

            //// Console.WriteLine(" new averaf  "+newav);
            // //Console.WriteLine(output);

            int sum = 0;
                sum=(min + av );
            sum += max;
            int temp = (sum / 3);

            //sum = temp;
            int temp1 = (sum - max);
            if (temp < temp1)
                Console.WriteLine(temp);
            else
                Console.WriteLine(sum-max);
             //Console.ReadKey();

        }

    }
}

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

namespace TestProject
{
	class Program
	{
		//538A - Cutting banner
		static void Main(string[] args)
		{
			String test = null;
#if LOCALTEST
			test = "../../test.txt";
#endif
			FastReader reader = new FastReader(test);
			int result, tmp;
			int[] a = new int[3];
			for (int i = 0; i < a.Length; ++i)
			{
				a[i] = reader.nextInt();
			}

			result = 0;
			for (int i = 0; i < 3; ++i)
			{
				Array.Sort(a);
				tmp = Math.Min(a[2] / 2, a[1]);
				result += tmp;
				a[2] -= tmp * 2;
				a[1] -= tmp;
			}
			Array.Sort(a);
			result += a[0];
			Console.Write(result);

#if LOCALTEST
			Console.ReadLine();
#endif
		}
	}

	class FastReader
	{
		private TextReader reader = null;
		private Queue<String> q = null;

		public FastReader(String fileName)
		{
			try
			{
				if (fileName != null)
				{
					reader = new StreamReader(fileName);
				}
				else
				{
					reader = System.Console.In;
				}
			}
			catch (FileNotFoundException e)
			{
				throw e;
			}
		}

		public FastReader()
		{
			reader = System.Console.In;
		}

		public String next() {
			while (q == null || q.Count == 0)
			{
				q = new Queue<string>(reader.ReadLine().Split());
			}
			return q.Dequeue();
		}

		public int nextInt()
		{
			return Int32.Parse(next());
		}

		public long nextLong()
		{
			return Int64.Parse(next());
		}

		public double nextDouble()
		{
			return Double.Parse(next());
		}
	}

}

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

namespace TestProject
{
	class Program
	{
		//538A - Cutting banner
		static void Main(string[] args)
		{
			String test = null;
#if LOCALTEST
			test = "../../test.txt";
#endif
			FastReader reader = new FastReader(test);
			long result, tmp;
			long[] a = new long[3];
			for (int i = 0; i < a.Length; ++i)
			{
				a[i] = reader.nextLong();
			}

			Array.Sort(a);
			result = a[0];

			a[1] -= a[0];
			a[2] -= a[0];
			a[0] -= a[0];

			tmp = Math.Min(a[1], a[2] - a[1]);
			tmp = Math.Min(tmp, a[2] / 2);
			result += tmp;

			a[1] -= tmp;
			a[2] -= 2 * tmp;

			if (a[1] > 0 && a[2] > 0)
			{
				result += (a[1] + a[2]) / 3;
			}

			Console.Write(result);

#if LOCALTEST
			Console.ReadLine();
#endif
		}
	}

	class FastReader
	{
		private TextReader reader = null;
		private Queue<String> q = null;

		public FastReader(String fileName)
		{
			try
			{
				if (fileName != null)
				{
					reader = new StreamReader(fileName);
				}
				else
				{
					reader = System.Console.In;
				}
			}
			catch (FileNotFoundException e)
			{
				throw e;
			}
		}

		public FastReader()
		{
			reader = System.Console.In;
		}

		public String next() {
			while (q == null || q.Count == 0)
			{
				q = new Queue<string>(reader.ReadLine().Split());
			}
			return q.Dequeue();
		}

		public int nextInt()
		{
			return Int32.Parse(next());
		}

		public long nextLong()
		{
			return Int64.Parse(next());
		}

		public double nextDouble()
		{
			return Double.Parse(next());
		}
	}

}

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

namespace TestProject
{
	class Program
	{
		//538A - Cutting banner
		static void Main(string[] args)
		{
			String test = null;
#if LOCALTEST
			test = "../../test.txt";
#endif
			FastReader reader = new FastReader(test);
			int result;
			int[] a = new int[3];
			for (int i = 0; i < a.Length; ++i)
			{
				a[i] = reader.nextInt();
			}

			Array.Sort(a);
			result = a[0];
			a[1] -= a[0];
			a[2] -= a[0];
			result += Math.Min(a[1], a[2] / 2);
			Console.Write(result);

#if LOCALTEST
			Console.ReadLine();
#endif
		}
	}

	class FastReader
	{
		private TextReader reader = null;
		private Queue<String> q = null;

		public FastReader(String fileName)
		{
			try
			{
				if (fileName != null)
				{
					reader = new StreamReader(fileName);
				}
				else
				{
					reader = System.Console.In;
				}
			}
			catch (FileNotFoundException e)
			{
				throw e;
			}
		}

		public FastReader()
		{
			reader = System.Console.In;
		}

		public String next() {
			while (q == null || q.Count == 0)
			{
				q = new Queue<string>(reader.ReadLine().Split());
			}
			return q.Dequeue();
		}

		public int nextInt()
		{
			return Int32.Parse(next());
		}

		public long nextLong()
		{
			return Int64.Parse(next());
		}

		public double nextDouble()
		{
			return Double.Parse(next());
		}
	}

}

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

namespace TestProject
{
	class Program
	{
		//538A - Cutting banner
		static void Main(string[] args)
		{
			String test = null;
#if LOCALTEST
			test = "../../test.txt";
#endif
			FastReader reader = new FastReader(test);
			int result, tmp;
			int[] a = new int[3];
			for (int i = 0; i < a.Length; ++i)
			{
				a[i] = reader.nextInt();
			}

			Array.Sort(a);
			result = a[0];
			a[1] -= a[0];
			a[2] -= a[0];

			tmp = Math.Min(a[1], a[2] / 2);
			result += tmp;
			a[1] -= tmp;
			a[2] -= 2 * tmp;

			tmp = Math.Min(a[2], a[1] / 2);
			result += tmp;

			Console.Write(result);

#if LOCALTEST
			Console.ReadLine();
#endif
		}
	}

	class FastReader
	{
		private TextReader reader = null;
		private Queue<String> q = null;

		public FastReader(String fileName)
		{
			try
			{
				if (fileName != null)
				{
					reader = new StreamReader(fileName);
				}
				else
				{
					reader = System.Console.In;
				}
			}
			catch (FileNotFoundException e)
			{
				throw e;
			}
		}

		public FastReader()
		{
			reader = System.Console.In;
		}

		public String next() {
			while (q == null || q.Count == 0)
			{
				q = new Queue<string>(reader.ReadLine().Split());
			}
			return q.Dequeue();
		}

		public int nextInt()
		{
			return Int32.Parse(next());
		}

		public long nextLong()
		{
			return Int64.Parse(next());
		}

		public double nextDouble()
		{
			return Double.Parse(next());
		}
	}

}

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

namespace TestProject
{
	class Program
	{
		//538A - Cutting banner
		static void Main(string[] args)
		{
			String test = null;
#if LOCALTEST
			test = "../../test.txt";
#endif
			FastReader reader = new FastReader(test);
			long result, tmp;
			long[] a = new long[3];
			for (int i = 0; i < a.Length; ++i)
			{
				a[i] = reader.nextLong();
			}

			Array.Sort(a);
			result = a[0];

			a[1] -= a[0];
			a[2] -= a[0];
			a[0] -= a[0];

			tmp = Math.Min(a[1], a[2] - a[1]);
			tmp = Math.Min(tmp, a[1] / 2);
			result += tmp;

			a[1] -= tmp;
			a[2] -= 2 * tmp;

			if (a[1] > 0 && a[2] > 0)
			{
				result += (a[1] + a[2]) / 3;
			}

			Console.Write(result);

#if LOCALTEST
			Console.ReadLine();
#endif
		}
	}

	class FastReader
	{
		private TextReader reader = null;
		private Queue<String> q = null;

		public FastReader(String fileName)
		{
			try
			{
				if (fileName != null)
				{
					reader = new StreamReader(fileName);
				}
				else
				{
					reader = System.Console.In;
				}
			}
			catch (FileNotFoundException e)
			{
				throw e;
			}
		}

		public FastReader()
		{
			reader = System.Console.In;
		}

		public String next() {
			while (q == null || q.Count == 0)
			{
				q = new Queue<string>(reader.ReadLine().Split());
			}
			return q.Dequeue();
		}

		public int nextInt()
		{
			return Int32.Parse(next());
		}

		public long nextLong()
		{
			return Int64.Parse(next());
		}

		public double nextDouble()
		{
			return Double.Parse(next());
		}
	}

}

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

namespace TestProject
{
	class Program
	{
		//538A - Cutting banner
		static void Main(string[] args)
		{
			String test = null;
#if LOCALTEST
			test = "../../test.txt";
#endif
			FastReader reader = new FastReader(test);
			int result, tmp;
			int[] a = new int[3];
			for (int i = 0; i < a.Length; ++i)
			{
				a[i] = reader.nextInt();
			}

			result = 0;
			tmp = 0;
			bool found = false;
			while (!found)
			{
				Array.Sort(a);
				tmp = 0;
				if (a[0] + a[1] + a[2] < 3) found = true;
				if (a[2] == 1 && a[0] == 1)
				{
					found = true;
					result += 1;
					a[0] -= 1;
					a[1] -= 1;
					a[2] -= 1;
					continue;
				}

				if (a[2] >= 2 && a[1] >= 1)
				{
					tmp = 1;
					a[2] -= 2;
					a[1] -= 1;
				}
				result += tmp;

			}

			Array.Sort(a);
			result += a[0];
			Console.Write(result);

#if LOCALTEST
			Console.ReadLine();
#endif
		}
	}

	class FastReader
	{
		private TextReader reader = null;
		private Queue<String> q = null;

		public FastReader(String fileName)
		{
			try
			{
				if (fileName != null)
				{
					reader = new StreamReader(fileName);
				}
				else
				{
					reader = System.Console.In;
				}
			}
			catch (FileNotFoundException e)
			{
				throw e;
			}
		}

		public FastReader()
		{
			reader = System.Console.In;
		}

		public String next() {
			while (q == null || q.Count == 0)
			{
				q = new Queue<string>(reader.ReadLine().Split());
			}
			return q.Dequeue();
		}

		public int nextInt()
		{
			return Int32.Parse(next());
		}

		public long nextLong()
		{
			return Int64.Parse(next());
		}

		public double nextDouble()
		{
			return Double.Parse(next());
		}
	}

}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq.Expressions;

namespace prC {

    internal class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        static readonly StreamWriter writer = new StreamWriter("output");
        static readonly StreamReader reader = new StreamReader("input");
#endif

        static void Main(string[] args) {
            int[] c = Array.ConvertAll(reader.ReadLine().Split(' '), int.Parse);
            Array.Sort(c);
            int n = c[0];
            c[0] -= n;
            c[1] -= n;
            c[2] -= n;
            int ans = n;
            int q = Math.Min(c[2] / 2, Math.Min(n, c[1]));
            ans += q;
            c[0] = n - q;
            c[1] -= q;
            c[2] -= 2 * q;
            if(c[0] != 0) {
                ans += Math.Min(c[0], c[2] / 2);
            }
            else if(c[1] > 0 && c[2] > 0) {
                int w = Math.Min(c[1], c[2] / 2);
                c[1] -= w;
                c[2] -= 2 * w;
                Array.Sort(c);
                ans += w;
                ans += Math.Min(c[1], c[2] / 2);
            }
            writer.WriteLine(ans);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq.Expressions;

namespace prC {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif
        static void Main(string[] args) {
            long[] a = new long[3];
            a[0] = Next();
            a[1] = Next();
            a[2] = Next();
            Array.Sort(a);
            long b = a[0];
            long g = a[1];
            long r = a[2];
            long t1 = b;
            t1 += Math.Min((r - b) / 2, g - b);
            long t2 = b;
            r = Math.Max(0, r - 2 * b);
            if(r != 0) {
                if(r >= g * 2) {
                    t2 += g;
                } else {
                    t2 += Math.Max(Math.Min(g, r / 2), Math.Min(r, g / 2));
                }
            }
            writer.WriteLine(Math.Max(t1, t2));

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq.Expressions;

namespace prC {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif
        static void Main(string[] args) {
            long[] a = new long[3];
            a[0] = Next();
            a[1] = Next();
            a[2] = Next();
            Array.Sort(a);
            long b = a[0];
            long g = a[1];
            long r = a[2];
            long t = b;
            g -= t;
            r -= t;
            t += Math.Min(r / 2, g);
            writer.WriteLine(t);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq.Expressions;

namespace prC {

    internal class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        static readonly StreamWriter writer = new StreamWriter("output");
        static readonly StreamReader reader = new StreamReader("input");
#endif

        static long TryAll(long r, long g, long b) {
            long ans = TryRGB(r, g, b);
            ans = Math.Max(ans, TryRRG(r, g, b));
            ans = Math.Max(ans, TryRRB(r, g, b));
            ans = Math.Max(ans, TryGGR(r, g, b));
            ans = Math.Max(ans, TryGGB(r, g, b));
            ans = Math.Max(ans, TryBBR(r, g, b));
            ans = Math.Max(ans, TryBBG(r, g, b));
            return ans;
        }

        static long TryRGB(long r, long g, long b) {
            long ans = Math.Min(r, Math.Min(g, b));
            r -= ans;
            g -= ans;
            b -= ans;
            if(ans != 0)
                ans += TryAll(r, g, b);
            return ans;
        }

        static long TryRRG(long r, long g, long b) {
            long ans = Math.Min(r / 2, g);
            r -= ans * 2;
            g -= ans;
            if(ans != 0)
                ans += TryAll(r, g, b);
            return ans;
        }
        static long TryRRB(long r, long g, long b) {
            long ans = Math.Min(r / 2, b);
            r -= ans * 2;
            b -= ans;
            if(ans != 0)
                ans += TryAll(r, g, b);
            return ans;
        }
        static long TryGGB(long r, long g, long b) {
            long ans = Math.Min(g / 2, b);
            g -= ans * 2;
            b -= ans;
            if(ans != 0)
                ans += TryAll(r, g, b);
            return ans;
        }
        static long TryGGR(long r, long g, long b) {
            long ans = Math.Min(g / 2, r);
            g -= ans * 2;
            r -= ans;
            if(ans != 0)
                ans += TryAll(r, g, b);
            return ans;
        }
        static long TryBBR(long r, long g, long b) {
            long ans = Math.Min(b / 2, r);
            b -= ans * 2;
            r -= ans;
            if(ans != 0)
                ans += TryAll(r, g, b);
            return ans;
        }
        static long TryBBG(long r, long g, long b) {
            long ans = Math.Min(b / 2, g);
            b -= ans * 2;
            g -= ans;
            if(ans != 0)
                ans += TryAll(r, g, b);
            return ans;
        }

        static void Main(string[] args) {
            long r = Next();
            long g = Next();
            long b = Next();
            long ans = TryAll(r, g, b);
            writer.WriteLine(ans);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq.Expressions;

namespace prC {

    internal class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        static readonly StreamWriter writer = new StreamWriter("output");
        static readonly StreamReader reader = new StreamReader("input");
#endif

        static void Main(string[] args) {
            int[] c = Array.ConvertAll(reader.ReadLine().Split(' '), int.Parse);
            Array.Sort(c);
            int ans = c[2] >= 2 * (c[0] + c[1]) ? c[0] + c[1] : (c[0] + c[1] + c[2]) / 3;
            writer.WriteLine(ans);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

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

	class contest
	{

		static void Main(string[] args)
		{

			var num = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            //int r = num[0];
            //int g = num[1];
            //int b = num[2];

            Array.Sort(num);
            int mxTable = 0;
            var arr = new string[] {"012","021","120","210","102","201","111","003","030","003" };

            var cp = new int[3];
            for(int i =0; i<10; i++)
            {
                int cnt = 0;
                num.CopyTo(cp,0);
                for(int j =i; j<10; j++)
                {
                    int a = (arr[j][0]-'0');
                    int b = arr[j][1] - '0';
                    int c = arr[j][2] - '0';

                    if(cp[0]>=a && cp[1]>=b && cp[2]>=c)
                    {
                        cp[0] -= a;
                        cp[1] -= b;
                        cp[2] -= c;
                        cnt++;
                    }

                }
                mxTable = Math.Max(mxTable, cnt);
            }

            Console.WriteLine(mxTable);

        }

	}

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

	class contest
	{

		static void Main(string[] args)
		{
		          var num = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            Array.Sort(num);
            int mxTable = num.Min();

            var cp = new List<int>(num);
            int min = num.Min();
            for (int i =0; i<3; i++)
            {
                cp[i] -= min;
            }

            while(cp[1]>=1 && cp[2]>=2)
            {
                if (cp[1] >= 1 && cp[2] >= 2)
                {
                    mxTable++;
                    cp[1] -= 1;
                    cp[2] -= 2;
                }

            }

            cp = num.ToList();

            if (cp[0] * 2 <= cp[2])
            {
                int tmp = cp[0];
                cp[2] -= cp[0] * 2;
                cp[0] = 0;

                while (cp[1] >= 1 && cp[2] >= 2)
                {
                    if (cp[1] >= 1 && cp[2] >= 2)
                    {
                        tmp++;
                        cp[1] -= 1;
                        cp[2] -= 2;
                    }

                    if (cp[1] > cp[2])
                    {
                        cp.Sort();
                    }
                }
                mxTable = Math.Max(mxTable,tmp);
            }

            Console.WriteLine(mxTable);

        }

	}

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

	class contest
	{

		static void Main(string[] args)
		{
		          var num = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

            Array.Sort(num);
            long mxTable = num.Min() ;

            var cp = new long[3];
            num.CopyTo(cp, 0);
            long min = num.Min();
            long sum = num.Sum();

            num.CopyTo(cp, 0);

            if (cp[0] > 0 || cp[1] > 0)
            {
                long tmp = 0;

                //while (cp[0]>0 && cp[2] >= cp[0] * 2)
                //{
                //    long red = Math.Min(cp[0], Math.Min(cp[2]-cp[1], cp[2] / 2));
                //    cp[0] -= red;
                //    cp[2] -= red*2;

                //    tmp += red;
                //    Array.Sort(cp);
                //}

                while (cp[1] > 0 && cp[2] > 1)
                {
                    long red = 0;
                    //if(cp[0]>1) //(cp[0]>1 && cp[0]*2 >= cp[1])
                    //{
                    //     red = Math.Min(cp[1], Math.Min( cp[0]/2  , cp[2] / 2));

                    //}
                    //else red = Math.Min(cp[1],  cp[2] / 2);

                    if (cp[1] >= 4) red = cp[1] / 4;
                    else red = Math.Min(cp[1],cp[2]/2);

                    cp[1] -= red;
                    cp[2] -= red * 2;

                    tmp += red;
                    Array.Sort(cp);
                }

                if (cp[0] == 1) tmp++;
                //if (sum % 2 == 1) tmp++;

                mxTable = Math.Max(mxTable, tmp);
            }

            Console.WriteLine(mxTable);

        }

	}

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

	class contest
	{

		static void Main(string[] args)
		{
		           var num = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

            Array.Sort(num);
            long mxTable = num.Min() ;

            var cp = new long[3];
            num.CopyTo(cp, 0);
            long min = num.Min();
            //for(int i =0; i<3; i++)
            //{
            //    cp[i] -= (min );
            //}

            //while (cp[1] >= 1 && cp[2] >= 2)
            //{
            //    if (cp[1] >= 1 && cp[2] >= 2)
            //    {
            //        mxTable++;
            //        cp[1] -= 1;
            //        cp[2] -= 2;
            //    }

            //    Array.Sort(cp);
            //}

            //cp = num.ToList();
            //while(true)
            //{
            //    long count = Math.Min(cp[0], cp[1] / 2);
            //    cp[0] -= count;
            //    cp[1] -= count;

            //}

            num.CopyTo(cp,0);
            long cnt = cp[0];
            if(cp[0]*2<=cp[2])
            {

                cp[2] -= cp[0] * 2;
                cp[0] = 0;

                Array.Sort(cp);
                if (cp[1] >= 1 && cp[2] >= 2)
                {
                   long rr = Math.Min(cp[1],cp[2]/2);
                    cp[1] -= rr;
                    cp[2] -= rr * 2;
                    Array.Sort(cp);
                    if(cp[1]>=1 && cp[2]>=2)
                    {
                        rr += Math.Min(cp[1],cp[2]/2); ;
                    }
                    cnt += rr;
                }
            }

            mxTable = Math.Max(mxTable, cnt);

            //Console.WriteLine(mxTable);

            //int count = 0;
            //int rest = 0;
            //for(int i=0; i<3; i++)
            //{
            //    count += num[i] / 3;
            //    rest += num[i] % 3;
            //}
            //count += rest / 3;

            //mxTable = Math.Max(mxTable, count);

            //while (cp[1] >= 1 && cp[2] >= 2)
            //{
            //    if (cp[1] >= 1 && cp[2] >= 2)
            //    {
            //        mxTable++;
            //        cp[1] -= 1;
            //        cp[2] -= 2;
            //    }

            //}

            num.CopyTo(cp, 0);

            if (cp[0] > 0 || cp[1] > 0)
            {
                long tmp = 0;

                //long a = cp[0] + cp[1];
                //long b = cp[2];
                //while (a >= 1 && b >= 2)
                //{
                //    a = cp[0] + cp[1];
                //    b = cp[2];
                //    long red = Math.Min(a,b/2);
                //    cp[0] -= red;
                //    cp[1] -= red;
                //    cp[2] -= red * 2;

                //    tmp += red;
                //    Array.Sort(cp);
                //}

                //while (cp[0]>0 && cp[2] >= cp[0] * 2)
                //{
                //    long red = Math.Min(cp[0], Math.Min(cp[2]-cp[1], cp[2] / 2));
                //    cp[0] -= red;
                //    cp[2] -= red*2;

                //    tmp += red;
                //    Array.Sort(cp);
                //}

                while (cp[1] > 0 && cp[2] > 1)
                {
                    long red = Math.Min(cp[1], Math.Min((cp[0]>1)?cp[0]/2:1, cp[2] / 2));
                    cp[1] -= red;
                    cp[2] -= red * 2;

                    tmp += red;
                    Array.Sort(cp);
                }

                mxTable = Math.Max(mxTable, tmp);
            }

            Console.WriteLine(mxTable);

        }

	}

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

	class contest
	{

		static void Main(string[] args)
		{

var num = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            Array.Sort(num);
            int mxTable = num.Min() ;

            var cp = new List<int>(num);
            int min = num.Min();
            for(int i =0; i<3; i++)
            {
                cp[i] -= (min );
            }

            while (cp[1] >= 1 && cp[2] >= 2)
            {
                if (cp[1] >= 1 && cp[2] >= 2)
                {
                    mxTable++;
                    cp[1] -= 1;
                    cp[2] -= 2;
                }

                cp.Sort();
            }

            cp = num.ToList();
            int cnt = cp[0];
            if(cp[0]*2<=cp[2])
            {

                cp[2] -= cp[0] * 2;
                cp[0] = 0;

                cp.Sort();
                if (cp[1] >= 1 && cp[2] >= 2)
                {
                   int rr = Math.Min(cp[1],cp[2]/2);
                    cp[1] -= rr;
                    cp[2] -= rr * 2;
                    cp.Sort();
                    if(cp[1]>=1 && cp[2]>=2)
                    {
                        rr++;
                    }
                    cnt += rr;
                }
            }

            mxTable = Math.Max(mxTable, cnt);
            Console.WriteLine(mxTable);

        }

	}

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

	class contest
	{

		static void Main(string[] args)
		{
		          var num = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

            Array.Sort(num);
            long mxTable = num.Min() ;

            var cp = new long[3];
            num.CopyTo(cp, 0);
            long min = num.Min();

            num.CopyTo(cp, 0);

            if (cp[0] > 0 || cp[1] > 0)
            {
                long tmp = 0;

                //while (cp[0]>0 && cp[2] >= cp[0] * 2)
                //{
                //    long red = Math.Min(cp[0], Math.Min(cp[2]-cp[1], cp[2] / 2));
                //    cp[0] -= red;
                //    cp[2] -= red*2;

                //    tmp += red;
                //    Array.Sort(cp);
                //}

                while (cp[1] > 0 && cp[2] > 1)
                {
                    long red = 0;
                    if (cp[0] > 1)
                    {
                         red = Math.Min(cp[1], Math.Min( cp[1] / 2 , cp[2] / 2));
                    }
                    else red = Math.Min(cp[1],  cp[2] / 2);

                    cp[1] -= red;
                    cp[2] -= red * 2;

                    tmp += red;
                    Array.Sort(cp);
                }

                if (cp[0] == 1) tmp++;

                mxTable = Math.Max(mxTable, tmp);
            }

            Console.WriteLine(mxTable);

        }

	}

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

	class contest
	{

		static void Main(string[] args)
		{

var num = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            Array.Sort(num);
            int mxTable = num.Min();

            var cp = new List<int>(num);

            int count = 0;
            int rest = 0;
            for(int i=0; i<3; i++)
            {
                count += num[i] / 3;
                rest += num[i] % 3;
            }
            count += rest / 3;

            mxTable = Math.Max(mxTable, count);
            Console.WriteLine(mxTable);

        }

	}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var b = ReadLongArray().Where(d => d > 0).OrderBy(d => d).ToArray();
        var len = b.Length;
        long a = 0;
        if (len == 3)
        {
            var tmp = (b[2] + b[1] - 2 * b[0]) / 3;
            a = b[0] + Math.Min(tmp, b[1]);
        }
        else if (len == 2)
        {
            a = b[1];
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var b = ReadLongArray().Where(d => d > 0).OrderBy(d => d).ToArray();
        var len = b.Length;
        long a = 0;
        if (len == 3)
        {
            var tmp = (b[2] + b[1] - 2 * b[0]) / 3;
            a = b[0] + Math.Min(tmp, b[1]);
        }
        else if (len == 2)
        {
            a = b[0];
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var r = ReadLong();
        var g = ReadLong();
        var b = ReadLong();
        var balloon = new[] { r, g, b }.Where(d => d != 0).OrderBy(d => d).ToArray();
        var a = 0L;
        if (balloon.Length == 3)
        {
            a = balloon[0];
            var tmp = balloon[1] - balloon[0];
            var tmp1 = balloon[2] - balloon[0];
            a += Math.Min(tmp, (tmp + tmp1) / 3);
        }
        else if (balloon.Length == 2)
        {
            a = Math.Min(balloon[0], balloon.Sum() / 3);
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var b = ReadLongArray().Where(d => d > 0).OrderBy(d => d).ToArray();
        var len = b.Length;
        long a = 0;
        if (len == 3)
        {
            var tmp = (b[2] + b[1] - 2 * b[0]) / 3;
            a = b[0] + Math.Min(tmp, b[1]);
        }
        else if (len == 2)
        {
            a = b[0] + b[1] / 3;
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var b = ReadLongArray().Where(d => d > 0).OrderBy(d => d).ToArray();
        var len = b.Length;
        long a = 0;
        if (len == 3)
        {
            var tmp = b[2] - 2 * b[0];
            a = tmp <= 0 ? b[0] : Math.Min(tmp, b[1]);
        }
        else if (len == 2)
        {
            a = b[0];
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var r = ReadLong();
        var g = ReadLong();
        var b = ReadLong();
        var balloon = new[] { r, g, b }.Where(d => d != 0).OrderByDescending(d => d).ToArray();
        var a = 0L;
        if (balloon.Length == 3)
        {
            a = balloon[2];
            var tmp = balloon[0] - a;
            var tmp1 = balloon[1] - a;
            a += Math.Min(tmp, (tmp + tmp1) / 3);
        }
        else if (balloon.Length == 2)
        {
            a = Math.Min(balloon[1], balloon.Sum() / 3);
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var r = ReadInt();
        var g = ReadInt();
        var b = ReadInt();
        writer.WriteLine("{0}", Math.Min(r, Math.Min(g, b)) + (r + g + b - 3 * Math.Min(r, Math.Min(g, b))) / 3);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var b = ReadLongArray().Where(d => d > 0).OrderBy(d => d).ToArray();
        var len = b.Length;
        long a = 0;
        if (len == 3)
        {
            var tmp = (b[2] + b[1] - 2 * b[0]) / 3;
            a = b[0] + Math.Min(tmp, b[1]);
        }
        else if (len == 2)
        {
            a = (b[0] + b[1]) / 3;
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var r = ReadLong();
        var g = ReadLong();
        var b = ReadLong();
        var balloon = new[] { r, g, b }.Where(d => d != 0).OrderBy(d => d).ToArray();
        var a = 0L;
        if (balloon.Length == 3)
        {
            a = balloon[0] + (balloon.Sum() - 3 * balloon[0]) / 3;
        }
        else if (balloon.Length == 2)
        {
            a = Math.Min(balloon[0], balloon.Sum() / 3);
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
public class Codeforces
{
    protected static TextReader reader;
    protected static TextWriter writer;
    static object Solve()
    {
        var r = ReadLong();
        var g = ReadLong();
        var b = ReadLong();
        var balloon = new[] { r, g, b }.Where(d => d != 0).OrderByDescending(d => d).ToArray();
        var a = 0L;
        if (balloon.Length == 3)
        {
            a = balloon[2];
            var tmp = balloon[0] - a;
            var tmp1 = balloon[1] - a;
            a += Math.Min(tmp, (tmp + tmp1) / 3);
        }
        else if (balloon.Length == 2)
        {
            a = Math.Min(balloon[0], balloon.Sum() / 3);
        }
        else
        {
            a = 0;
        }
        writer.WriteLine(a);
        return null;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        try
        {
            object result = Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
            throw;
        }
        reader.Close();
        writer.Close();
    }
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

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

namespace ReadTemplate
{
    public class Solver
    {
        public static void Solve()
        {
            long ans = 0;
            var a = ReadLongArray();
            Array.Sort(a);
            while (a[1] > 0 && a.Sum() >= 3)
            {
                long d = a[2] - a[1];
                if (d > 1)
                {
                    long b = a[1] - a[0];
                    long c = Math.Min(d / 2, b);
                    ans += c;
                    a[2] -= 2 * c;
                    a[1] -= c;

                    if (a[0] == a[1])
                    {
                        d = a[2] - a[1];
                        if (d > 1)
                        {
                            c = Math.Min(d / 2, 2 * a[0]);
                            ans += c;
                            a[0] -= c / 2;
                            a[1] -= (c + 1) / 2;
                        }
                        Array.Sort(a);
                    }
                }
                else
                {
                    ans += a.Sum() / 3;
                    break;
                }
            }
            Console.WriteLine(ans);
        }

        public static void Main()
        {
            Reader = Console.In; Writer = Console.Out;
            //Reader = File.OpenText("input.txt"); Writer = File.CreateText("output.txt");

            Solve();

            Reader.Close();
            Writer.Close();
        }

        #region Read/Write

        private static TextReader Reader;

        private static TextWriter Writer;

        private static Queue<string> CurrentLineTokens = new Queue<string>();

        private static string[] ReadAndSplitLine()
        {
            return Reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        public static string ReadToken()
        {
            while (CurrentLineTokens.Count == 0)
                CurrentLineTokens = new Queue<string>(ReadAndSplitLine());
            return CurrentLineTokens.Dequeue();
        }

        public static int ReadInt()
        {
            return int.Parse(ReadToken());
        }

        public static long ReadLong()
        {
            return long.Parse(ReadToken());
        }

        public static double ReadDouble()
        {
            return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
        }

        public static int[] ReadIntArray()
        {
            return ReadAndSplitLine().Select(int.Parse).ToArray();
        }

        public static long[] ReadLongArray()
        {
            return ReadAndSplitLine().Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
        }

        public static int[][] ReadIntMatrix(int numberOfRows)
        {
            int[][] matrix = new int[numberOfRows][];
            for (int i = 0; i < numberOfRows; i++)
                matrix[i] = ReadIntArray();
            return matrix;
        }

        public static string[] ReadLines(int quantity)
        {
            string[] lines = new string[quantity];
            for (int i = 0; i < quantity; i++)
                lines[i] = Reader.ReadLine().Trim();
            return lines;
        }

        public static void WriteArray<T>(IEnumerable<T> array)
        {
            Writer.WriteLine(string.Join(" ", array));
        }

        #endregion
    }
}

using System;

public class Test
{
	static long caseType = -1;
		static long maxNum = -1;
		static long secondMaxNum = -1;
		static long minNum = -1;
		static long sameNumber = -1;
		static long diffNumber = -1;
		static long answer = 0;
		public static void Main()
		{
			var numbers = Console.ReadLine().Split(' ');
			var r = long.Parse(numbers[0]);
			var g = long.Parse(numbers[1]);
			var b = long.Parse(numbers[2]);

			DetermineCase(r, g, b);
			Casehandler(r, g, b);

			Console.Write(answer);

		}

		static void Casehandler(long r, long g, long b) {
			if (caseType == 1)
			{
				if (minNum != 0)
				{
					long x = (maxNum - secondMaxNum + (2 * minNum))/4;
					var y = minNum - x;

					long z = 0;
					if (y > x) {
						z = y;
						y = x;
						x = z;
					}
					answer += minNum;

					var newr = maxNum - (2 * x);
					var newg = secondMaxNum - (2 * y);
					var newb = 0;
					DetermineCase(newr, newg, newb);
					Casehandler(newr, newg, newb);
				}
				else {
					var x = maxNum - secondMaxNum;
					if (x > secondMaxNum) {
						x = secondMaxNum;
					}
					answer += x;
					var newr = maxNum - (2 * x);
					var newg = secondMaxNum - x;
					var newb = 0;
					DetermineCase(newr, newg, newb);
					Casehandler(newr, newg, newb);
				}

			}
			else if (caseType == 2)
			{
				if (r == 0 && g == 0 && b == 0)
				{
					return;
				}
				answer += r;
				return;
			}
			else if (caseType == 3)
			{
				if (sameNumber == 0 || sameNumber == 1) {
					return;
				}

				var x = (sameNumber - diffNumber) / 3;

				answer += (2 * x);
				var newr = sameNumber - (3 * x);
				var newg = newr;
				var newb = diffNumber;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 4)
			{
				if (sameNumber == 0 || sameNumber == 1)
				{
					return;
				}

				if (sameNumber == 2) {
					answer += 1;
					return;
				}

				answer += (diffNumber);
				DetermineCase(sameNumber - diffNumber, sameNumber - diffNumber, 0);
				Casehandler(sameNumber - diffNumber, sameNumber - diffNumber, 0);
			}
			else if (caseType == 5)
			{
				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}
				answer += (sameNumber);
				DetermineCase(diffNumber - sameNumber, 0, 0);
				Casehandler(diffNumber - sameNumber, 0, 0);
			}
			else if (caseType == 6) {

				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}

				var x = (diffNumber - sameNumber)/3;

				if (x > sameNumber) {
					x = sameNumber;
				}

				answer += (2 * x);
				var newr = diffNumber - (4 * x);
				var newg = sameNumber -  x;
				var newb = sameNumber - x;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}

		}

		static void DetermineCase(long r, long g, long b) {
			if (r != g && g != b && b != r)
			{
				caseType = 1; //all different
				maxNum = Math.Max(r, Math.Max(g, b));
				if (maxNum == r) {
					secondMaxNum = Math.Max(g, b);
					minNum = secondMaxNum == g ? b : g;
				} else if (maxNum == g)
				{
					secondMaxNum = Math.Max(r, b);
					minNum = secondMaxNum == r ? b : r;
				} else
				{
					secondMaxNum = Math.Max(g, r);
					minNum = secondMaxNum == g ? r : g;
				}
			}
			else if (r == g && g == b && b == r)
			{
				caseType = 2; //all same
			}
			else
			{
				if (r == g)
				{
					sameNumber = r;
					diffNumber = b;
				}
				else if (g == b)
				{
					sameNumber = g;
					diffNumber = r;
				}
				else if (r == b)
				{
					sameNumber = b;
					diffNumber = g;
				}

				if (sameNumber - diffNumber > 2)
				{
					caseType = 3; //58 58 40
				}
				else if (sameNumber - diffNumber == 1 || sameNumber - diffNumber == 2) {
					caseType = 4; //58 58 57
				}
				else if (diffNumber - sameNumber < 3)
				{
					caseType = 5; //28 26 26
				}
				else
				{
					caseType = 6; //30 27 27
				}
			}
		}

}

using System;

public class Test
{
	static int caseType = -1;
		static int maxNum = -1;
		static int secondMaxNum = -1;
		static int minNum = -1;
		static int sameNumber = -1;
		static int diffNumber = -1;
		static int answer = 0;

	public static void Main()
	{
		var numbers = Console.ReadLine().Split(' ');
			var r = int.Parse(numbers[0]);
			var g = int.Parse(numbers[1]);
			var b = int.Parse(numbers[2]);

			DetermineCase(r, g, b);
			Casehandler(r, g, b);

			Console.Write(answer);
	}

	static void Casehandler(int r, int g, int b) {
			if (caseType == 1)
			{
				var x = maxNum - secondMaxNum;
				if (x > secondMaxNum) {
					x = secondMaxNum;
				}
				answer += x;
				var newr = maxNum - (2 * x);
				var newg = secondMaxNum - x;
				var newb = minNum;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 2)
			{
				if (r == 0 && g == 0 && b == 0)
				{
					return;
				}
				answer += r;
				return;
			}
			else if (caseType == 3)
			{
				if (sameNumber == 0 || sameNumber == 1) {
					return;
				}

				var x = (sameNumber - diffNumber) / 3;

				answer += (2 * x);
				var newr = sameNumber - (3 * x);
				var newg = newr;
				var newb = diffNumber;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 4)
			{
				if (sameNumber == 0 || sameNumber == 1)
				{
					return;
				}

				if (sameNumber == 2) {
					answer += 1;
					return;
				}

				answer += (diffNumber);
				DetermineCase(sameNumber - diffNumber, sameNumber - diffNumber, 0);
				Casehandler(sameNumber - diffNumber, sameNumber - diffNumber, 0);
			}
			else if (caseType == 5)
			{
				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}
				answer += (sameNumber);
				DetermineCase(diffNumber - sameNumber, 0, 0);
				Casehandler(diffNumber - sameNumber, 0, 0);
			}
			else if (caseType == 6) {

				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}

				var x = (diffNumber - sameNumber)/3;

				if (x > sameNumber) {
					x = sameNumber;
				}

				answer += (2 * x);
				var newr = diffNumber - (4 * x);
				var newg = sameNumber -  x;
				var newb = sameNumber - x;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}

		}

		static void DetermineCase(int r, int g, int b) {
			if (r != g && g != b && b != r)
			{
				caseType = 1; //all different
				maxNum = Math.Max(r, Math.Max(g, b));
				if (maxNum == r) {
					secondMaxNum = Math.Max(g, b);
					minNum = secondMaxNum == g ? b : g;
				} else if (maxNum == g)
				{
					secondMaxNum = Math.Max(r, b);
					minNum = secondMaxNum == r ? b : r;
				} else
				{
					secondMaxNum = Math.Max(g, r);
					minNum = secondMaxNum == g ? r : g;
				}
			}
			else if (r == g && g == b && b == r)
			{
				caseType = 2; //all same
			}
			else
			{
				if (r == g)
				{
					sameNumber = r;
					diffNumber = b;
				}
				else if (g == b)
				{
					sameNumber = g;
					diffNumber = r;
				}
				else if (r == b)
				{
					sameNumber = b;
					diffNumber = g;
				}

				if (sameNumber - diffNumber > 2)
				{
					caseType = 3; //58 58 40
				}
				else if (sameNumber - diffNumber == 1 || sameNumber - diffNumber == 2) {
					caseType = 4; //58 58 57
				}
				else if (diffNumber - sameNumber < 3)
				{
					caseType = 5; //28 26 26
				}
				else
				{
					caseType = 6; //30 27 27
				}
			}
		}

}

using System;

public class Test
{
	static int caseType = -1;
		static int maxNum = -1;
		static int secondMaxNum = -1;
		static int minNum = -1;
		static int sameNumber = -1;
		static int diffNumber = -1;
		static int answer = 0;

	public static void Main()
	{
		var numbers = Console.ReadLine().Split(' ');
			var r = int.Parse(numbers[0]);
			var g = int.Parse(numbers[1]);
			var b = int.Parse(numbers[2]);

			DetermineCase(r, g, b);
			Casehandler(r, g, b);

			Console.Write(answer);
	}

	static void Casehandler(int r, int g, int b) {
			if (caseType == 1)
			{
				var diffMaxMin = (maxNum - minNum) / 2;
				var diffSecondmaxMin = secondMaxNum - minNum;

				var minDiff = Math.Min(diffMaxMin, diffSecondmaxMin);
				answer += minDiff;
				var newr = maxNum - (2 * minDiff);
				var newg = secondMaxNum - minDiff;
				var newb = minNum;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 2)
			{
				if (r == 0 && g == 0 && b == 0)
				{
					return;
				}
				answer += r;
				return;
			}
			else if (caseType == 3)
			{
				if (sameNumber == 0 || sameNumber == 1) {
					return;
				}

				var x = (sameNumber - diffNumber) / 3;
				answer += (2 * x);
				var newr = sameNumber - (3 * x);
				var newg = newr;
				var newb = diffNumber;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 4)
			{
				if (sameNumber == 0|| sameNumber == 1)
				{
					return;
				}

				answer += (diffNumber);
				DetermineCase(sameNumber - diffNumber, sameNumber - diffNumber, 0);
				Casehandler(sameNumber - diffNumber, sameNumber - diffNumber, 0);
			}
			else if (caseType == 5)
			{
				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}
				answer += (sameNumber);
				DetermineCase(diffNumber - sameNumber, 0, 0);
				Casehandler(diffNumber - sameNumber, 0, 0);
			}
			else if (caseType == 6) {

				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}

				var x = (diffNumber - sameNumber)/3;
				answer += (2 * x);
				var newr = diffNumber - (4 * x);
				var newg = sameNumber -  x;
				var newb = sameNumber - x;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}

		}

		static void DetermineCase(int r, int g, int b) {
			if (r != g && g != b && b != r)
			{
				caseType = 1; //all different
				maxNum = Math.Max(r, Math.Max(g, b));
				if (maxNum == r) {
					secondMaxNum = Math.Max(g, b);
					minNum = secondMaxNum == g ? b : g;
				} else if (maxNum == g)
				{
					secondMaxNum = Math.Max(r, b);
					minNum = secondMaxNum == r ? b : r;
				} else
				{
					secondMaxNum = Math.Max(g, r);
					minNum = secondMaxNum == g ? r : g;
				}
			}
			else if (r == g && g == b && b == r)
			{
				caseType = 2; //all same
			}
			else
			{
				if (r == g)
				{
					sameNumber = r;
					diffNumber = b;
				}
				else if (g == b)
				{
					sameNumber = g;
					diffNumber = r;
				}
				else if (r == b)
				{
					sameNumber = b;
					diffNumber = g;
				}

				if (sameNumber - diffNumber > 1)
				{
					caseType = 3; //58 58 40
				}
				else if (sameNumber - diffNumber == 1) {
					caseType = 4; //58 58 57
				}
				else if (diffNumber - sameNumber < 3)
				{
					caseType = 5; //28 26 26
				}
				else
				{
					caseType = 6; //30 27 27
				}
			}
		}

}

using System;

public class Test
{
	static long caseType = -1;
		static long maxNum = -1;
		static long secondMaxNum = -1;
		static long minNum = -1;
		static long sameNumber = -1;
		static long diffNumber = -1;
		static long answer = 0;
		public static void Main()
		{
			var numbers = Console.ReadLine().Split(' ');
			var r = long.Parse(numbers[0]);
			var g = long.Parse(numbers[1]);
			var b = long.Parse(numbers[2]);

			DetermineCase(r, g, b);
			Casehandler(r, g, b);

			Console.Write(answer);

		}

		static void Casehandler(long r, long g, long b) {
			if (caseType == 1)
			{
				if (minNum != 0)
				{
					long x = (maxNum - secondMaxNum + (2 * minNum))/4;
					var y = minNum - x;
					answer += minNum;

					var newr = maxNum - (2 * x);
					var newg = secondMaxNum - (2 * y);
					var newb = 0;
					DetermineCase(newr, newg, newb);
					Casehandler(newr, newg, newb);
				}
				else {
					var x = maxNum - secondMaxNum;
					if (x > secondMaxNum) {
						x = secondMaxNum;
					}
					answer += x;
					var newr = maxNum - (2 * x);
					var newg = secondMaxNum - x;
					var newb = 0;
					DetermineCase(newr, newg, newb);
					Casehandler(newr, newg, newb);
				}

			}
			else if (caseType == 2)
			{
				if (r == 0 && g == 0 && b == 0)
				{
					return;
				}
				answer += r;
				return;
			}
			else if (caseType == 3)
			{
				if (sameNumber == 0 || sameNumber == 1) {
					return;
				}

				var x = (sameNumber - diffNumber) / 3;

				answer += (2 * x);
				var newr = sameNumber - (3 * x);
				var newg = newr;
				var newb = diffNumber;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 4)
			{
				if (sameNumber == 0 || sameNumber == 1)
				{
					return;
				}

				if (sameNumber == 2) {
					answer += 1;
					return;
				}

				answer += (diffNumber);
				DetermineCase(sameNumber - diffNumber, sameNumber - diffNumber, 0);
				Casehandler(sameNumber - diffNumber, sameNumber - diffNumber, 0);
			}
			else if (caseType == 5)
			{
				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}
				answer += (sameNumber);
				DetermineCase(diffNumber - sameNumber, 0, 0);
				Casehandler(diffNumber - sameNumber, 0, 0);
			}
			else if (caseType == 6) {

				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}

				var x = (diffNumber - sameNumber)/3;

				if (x > sameNumber) {
					x = sameNumber;
				}

				answer += (2 * x);
				var newr = diffNumber - (4 * x);
				var newg = sameNumber -  x;
				var newb = sameNumber - x;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}

		}

		static void DetermineCase(long r, long g, long b) {
			if (r != g && g != b && b != r)
			{
				caseType = 1; //all different
				maxNum = Math.Max(r, Math.Max(g, b));
				if (maxNum == r) {
					secondMaxNum = Math.Max(g, b);
					minNum = secondMaxNum == g ? b : g;
				} else if (maxNum == g)
				{
					secondMaxNum = Math.Max(r, b);
					minNum = secondMaxNum == r ? b : r;
				} else
				{
					secondMaxNum = Math.Max(g, r);
					minNum = secondMaxNum == g ? r : g;
				}
			}
			else if (r == g && g == b && b == r)
			{
				caseType = 2; //all same
			}
			else
			{
				if (r == g)
				{
					sameNumber = r;
					diffNumber = b;
				}
				else if (g == b)
				{
					sameNumber = g;
					diffNumber = r;
				}
				else if (r == b)
				{
					sameNumber = b;
					diffNumber = g;
				}

				if (sameNumber - diffNumber > 2)
				{
					caseType = 3; //58 58 40
				}
				else if (sameNumber - diffNumber == 1 || sameNumber - diffNumber == 2) {
					caseType = 4; //58 58 57
				}
				else if (diffNumber - sameNumber < 3)
				{
					caseType = 5; //28 26 26
				}
				else
				{
					caseType = 6; //30 27 27
				}
			}
		}

}

using System;

public class Test
{
	static int caseType = -1;
		static int maxNum = -1;
		static int secondMaxNum = -1;
		static int minNum = -1;
		static int sameNumber = -1;
		static int diffNumber = -1;
		static int answer = 0;

	public static void Main()
	{
		var numbers = Console.ReadLine().Split(' ');
			var r = int.Parse(numbers[0]);
			var g = int.Parse(numbers[1]);
			var b = int.Parse(numbers[2]);

			DetermineCase(r, g, b);
			Casehandler(r, g, b);

			Console.Write(answer);
	}

	static void Casehandler(int r, int g, int b) {
			if (caseType == 1)
			{
				var diffMaxMin = (maxNum - minNum) / 2;
				var diffSecondmaxMin = secondMaxNum - minNum;

				var minDiff = Math.Min(diffMaxMin, diffSecondmaxMin);
				answer += minDiff;
				var newr = maxNum - (2 * minDiff);
				var newg = secondMaxNum - minDiff;
				var newb = minNum;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 2)
			{
				if (r == 0 && g == 0 && b == 0)
				{
					return;
				}
				answer += r;
				return;
			}
			else if (caseType == 3)
			{
				if (sameNumber == 0 || sameNumber == 1) {
					return;
				}

				var x = (sameNumber - diffNumber) / 3;
				answer += (2 * x);
				var newr = sameNumber - (3 * x);
				var newg = newr;
				var newb = diffNumber;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}
			else if (caseType == 4)
			{
				if (sameNumber == 0|| sameNumber == 1)
				{
					return;
				}

				answer += (diffNumber);
				DetermineCase(sameNumber - diffNumber, sameNumber - diffNumber, 0);
				Casehandler(sameNumber - diffNumber, sameNumber - diffNumber, 0);
			}
			else if (caseType == 5)
			{
				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}
				answer += (sameNumber);
				DetermineCase(diffNumber - sameNumber, 0, 0);
				Casehandler(diffNumber - sameNumber, 0, 0);
			}
			else if (caseType == 6) {

				if (sameNumber == 0 || diffNumber == 0)
				{
					return;
				}

				var x = (diffNumber - sameNumber)/3;

				if (x > sameNumber) {
					x = sameNumber;
				}

				answer += (2 * x);
				var newr = diffNumber - (4 * x);
				var newg = sameNumber -  x;
				var newb = sameNumber - x;

				DetermineCase(newr, newg, newb);
				Casehandler(newr, newg, newb);
			}

		}

		static void DetermineCase(int r, int g, int b) {
			if (r != g && g != b && b != r)
			{
				caseType = 1; //all different
				maxNum = Math.Max(r, Math.Max(g, b));
				if (maxNum == r) {
					secondMaxNum = Math.Max(g, b);
					minNum = secondMaxNum == g ? b : g;
				} else if (maxNum == g)
				{
					secondMaxNum = Math.Max(r, b);
					minNum = secondMaxNum == r ? b : r;
				} else
				{
					secondMaxNum = Math.Max(g, r);
					minNum = secondMaxNum == g ? r : g;
				}
			}
			else if (r == g && g == b && b == r)
			{
				caseType = 2; //all same
			}
			else
			{
				if (r == g)
				{
					sameNumber = r;
					diffNumber = b;
				}
				else if (g == b)
				{
					sameNumber = g;
					diffNumber = r;
				}
				else if (r == b)
				{
					sameNumber = b;
					diffNumber = g;
				}

				if (sameNumber - diffNumber > 1)
				{
					caseType = 3; //58 58 40
				}
				else if (sameNumber - diffNumber == 1) {
					caseType = 4; //58 58 57
				}
				else if (diffNumber - sameNumber < 3)
				{
					caseType = 5; //28 26 26
				}
				else
				{
					caseType = 6; //30 27 27
				}
			}
		}

}

using System;

namespace R_C_273
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int r = int.Parse(s[0]), g = int.Parse(s[1]), b = int.Parse(s[2]);
            int min = Math.Min(r, Math.Min(g, b)), sum = 0;
            r -= min;
            g -= min;
            b -= min;
            sum += min;
            int a1, a2;
            if (r == 0)
            {
                a1 = g;
                a2 = b;
            }
            else if (g == 0)
            {
                a1 = r;
                a2 = b;
            }
            else
            {
                a1 = r;
                a2 = g;
            }
            while (((a1 != 0) && (a2 != 0))&&(a1/2!=0)&&(a2/2!=0))
            {
                int k1 = Math.Max(a1, a2) / 2, k2 = Math.Min(a1, a2), k3 = Math.Min(k1, k2);
                a1 -= k3;
                a2 -= k3;
                sum += k3;
            }
            Console.WriteLine(sum);
        }
    }
}

using System;

namespace R_C_273
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int r = int.Parse(s[0]), g = int.Parse(s[1]), b = int.Parse(s[2]);
            int min = Math.Min(r, Math.Min(g, b)), sum = 0;
            r -= min;
            g -= min;
            b -= min;
            sum += min;
            int a1, a2;
            if (r == 0)
            {
                a1 = g;
                a2 = b;
            }
            else if (g == 0)
            {
                a1 = r;
                a2 = b;
            }
            else
            {
                a1 = r;
                a2 = g;
            }
            int k3 = 1;
            while ((a1 != 0) && (a2 != 0)&& (k3 != 0))
            {
                int k1 = Math.Max(a1, a2) / 2, k2 = Math.Min(a1, a2);
                k3 = Math.Min(k1, k2);
                a1 -= k3;
                a2 -= k3;
                sum += k3;
            }
            Console.WriteLine(sum);
            Console.ReadLine();
        }
    }
}

using System;

namespace R_C_273
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int r = int.Parse(s[0]), g = int.Parse(s[1]), b = int.Parse(s[2]);
            int sum = (r + g + b) / 3;
            sum = Math.Min(sum, r + g);
            sum = Math.Min(sum, r + b);
            sum = Math.Min(sum, g + b);
            Console.WriteLine(sum);
            Console.ReadLine();
        }
    }
}

using System;

namespace R_C_273
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int r = int.Parse(s[0]), g = int.Parse(s[1]), b = int.Parse(s[2]);
            long sum = (r + g + b) / 3;
            sum = Math.Min(sum, r + g);
            sum = Math.Min(sum, r + b);
            sum = Math.Min(sum, g + b);
            Console.WriteLine(sum);
            Console.ReadLine();
        }
    }
}

using System.Linq;

namespace codeforce
{
    class Program
    {
        class Point
        {
            public double X { get; private set; }
            public double Y { get; private set; }
            public Point(double X, double Y)
            {
                this.X = X;
                this.Y = Y;
            }
            public override bool Equals(object obj)
            {
                if (obj is Point)
                {
                    return this.X == ((Point)obj).X && this.Y == ((Point)obj).Y;
                }
                else return base.Equals(obj);
            }
            public override int GetHashCode()
            {
                return X.GetHashCode() + Y.GetHashCode();
            }
        }
        public static void Main()
        {
            System.Text.StringBuilder res = new System.Text.StringBuilder();
            var tests = 1;
            //tests = readInt();
            for (int i = 0; i < tests; ++i)
            {
                res.AppendLine(Solve());
            }

            System.Console.Out.WriteLine(res);
        }

        static string Solve()
        {
            var x = readSplitedInts(' ').ToList<int>();

            long res = 0;

            int m = x.Min();

            res += m;

            for (int i = 0; i < x.Count; ++i)
            {
                x[i] -= m;
            }
            x.RemoveAll(r => r == 0);

            if (x.Count == 2)
            {
                int min = x.Min();
                int max = x.Max();

                res += System.Math.Min(min, max / 2);
            }

            return res.ToString();
        }

        static int parseInt(string str)
        {
            int res = 0;
            for (int i = 0; i < str.Length; ++i)
            {
                res *= 10;
                switch (str[i])
                {
                    case '0':
                        res += 0;
                        break;
                    case '1':
                        res += 1;
                        break;
                    case '2':
                        res += 2;
                        break;
                    case '3':
                        res += 3;
                        break;
                    case '4':
                        res += 4;
                        break;
                    case '5':
                        res += 5;
                        break;
                    case '6':
                        res += 6;
                        break;
                    case '7':
                        res += 7;
                        break;
                    case '8':
                        res += 8;
                        break;
                    case '9':
                        res += 9;
                        break;
                }
            }
            if (str.StartsWith("-"))
            {
                res *= -1;
            }
            return res;
        }
        static int[] readSplitedInts(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            int[] res = new int[t.Length];
            for (int i = 0; i < t.Length; ++i)
            {
                res[i] = parseInt(t[i]);
            }
            return res;
        }
        static int readInt()
        {
            return parseInt(System.Console.In.ReadLine());
        }
        static string[] readSplited(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            return t;
        }
    }
}

using System.Linq;

namespace codeforce
{
    class Program
    {
        class Point
        {
            public double X { get; private set; }
            public double Y { get; private set; }
            public Point(double X, double Y)
            {
                this.X = X;
                this.Y = Y;
            }
            public override bool Equals(object obj)
            {
                if (obj is Point)
                {
                    return this.X == ((Point)obj).X && this.Y == ((Point)obj).Y;
                }
                else return base.Equals(obj);
            }
            public override int GetHashCode()
            {
                return X.GetHashCode() + Y.GetHashCode();
            }
        }
        public static void Main()
        {
            System.Text.StringBuilder res = new System.Text.StringBuilder();
            var tests = 1;
            //tests = readInt();
            for (int i = 0; i < tests; ++i)
            {
                res.AppendLine(Solve());
            }

            System.Console.Out.WriteLine(res);
        }

        static string Solve()
        {
            var x = readSplitedInts(' ').ToList<long>();

            long res = 0;

            x.Sort();

            long d1 = x[2] - x[1];
            long d2 = x[1] - x[0];

            long d = System.Math.Min(d1, d2);

            res += d;

            x[2] -= d * 2;
            x[1] -= d;

            d1 = x[2] - x[1];
            d2 = x[1] - x[0];

            if (x[0] == 0 && x[1] == 0)
            {
                return res.ToString();
            }
            if (d1 > 0)
            {
                long z = d1 / 3;

                res += z * 2;

                x[2] -= z * 4;
                x[1] -= z;
                x[0] -= z;
            }
            if (d2 > 0)
            {
                long z = d2 / 3 * 2 + (d2 % 3 == 2 ? 1 : 0);

                res += z;

                x[2] -= z / 2 + (z % 2 == 1 ? 2 : 0);
                x[1] -= z / 2 + (z % 2 == 1 ? 1 : 0);
            }

            res += x.Min();

            return res.ToString();

        }

        static long parseInt(string str)
        {
            int res = 0;
            for (int i = 0; i < str.Length; ++i)
            {
                res *= 10;
                switch (str[i])
                {
                    case '0':
                        res += 0;
                        break;
                    case '1':
                        res += 1;
                        break;
                    case '2':
                        res += 2;
                        break;
                    case '3':
                        res += 3;
                        break;
                    case '4':
                        res += 4;
                        break;
                    case '5':
                        res += 5;
                        break;
                    case '6':
                        res += 6;
                        break;
                    case '7':
                        res += 7;
                        break;
                    case '8':
                        res += 8;
                        break;
                    case '9':
                        res += 9;
                        break;
                }
            }
            if (str.StartsWith("-"))
            {
                res *= -1;
            }
            return res;
        }
        static long[] readSplitedInts(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            long[] res = new long[t.Length];
            for (int i = 0; i < t.Length; ++i)
            {
                res[i] = parseInt(t[i]);
            }
            return res;
        }
        static long readInt()
        {
            return parseInt(System.Console.In.ReadLine());
        }
        static string[] readSplited(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            return t;
        }
    }
}

using System.Linq;

namespace codeforce
{
    class Program
    {
        class Point
        {
            public double X { get; private set; }
            public double Y { get; private set; }
            public Point(double X, double Y)
            {
                this.X = X;
                this.Y = Y;
            }
            public override bool Equals(object obj)
            {
                if (obj is Point)
                {
                    return this.X == ((Point)obj).X && this.Y == ((Point)obj).Y;
                }
                else return base.Equals(obj);
            }
            public override int GetHashCode()
            {
                return X.GetHashCode() + Y.GetHashCode();
            }
        }
        public static void Main()
        {
            System.Text.StringBuilder res = new System.Text.StringBuilder();
            var tests = 1;
            //tests = readInt();
            for (int i = 0; i < tests; ++i)
            {
                res.AppendLine(Solve());
            }

            System.Console.Out.WriteLine(res);
        }

        static string Solve()
        {
            var x = readSplitedInts(' ').ToList<int>();

            long res = 0;
            x.RemoveAll(r => r == 0);

            while (x.Count > 1)
            {
                x.Sort();

                if (x.Count == 3)
                {
                    int length = x[2] - x[0];

                    if (length <= 1)
                    {
                        res += x[0];
                        break;
                    }
                    else
                    {
                        if (x[2] >= 2)
                        {
                            x[2] -= 2;
                            x[1] -= 1;
                            res++;
                            x.RemoveAll(r => r == 0);
                        }
                        else
                        {
                            res++;
                            break;
                        }
                    }
                }
                else
                {
                    res += System.Math.Min(x[0], x[1] / 2);
                    break;
                }

            }

            return res.ToString();
        }

        static int parseInt(string str)
        {
            int res = 0;
            for (int i = 0; i < str.Length; ++i)
            {
                res *= 10;
                switch (str[i])
                {
                    case '0':
                        res += 0;
                        break;
                    case '1':
                        res += 1;
                        break;
                    case '2':
                        res += 2;
                        break;
                    case '3':
                        res += 3;
                        break;
                    case '4':
                        res += 4;
                        break;
                    case '5':
                        res += 5;
                        break;
                    case '6':
                        res += 6;
                        break;
                    case '7':
                        res += 7;
                        break;
                    case '8':
                        res += 8;
                        break;
                    case '9':
                        res += 9;
                        break;
                }
            }
            if (str.StartsWith("-"))
            {
                res *= -1;
            }
            return res;
        }
        static int[] readSplitedInts(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            int[] res = new int[t.Length];
            for (int i = 0; i < t.Length; ++i)
            {
                res[i] = parseInt(t[i]);
            }
            return res;
        }
        static int readInt()
        {
            return parseInt(System.Console.In.ReadLine());
        }
        static string[] readSplited(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            return t;
        }
    }
}

using System.Linq;

namespace codeforce
{
    class Program
    {
        class Point
        {
            public double X { get; private set; }
            public double Y { get; private set; }
            public Point(double X, double Y)
            {
                this.X = X;
                this.Y = Y;
            }
            public override bool Equals(object obj)
            {
                if (obj is Point)
                {
                    return this.X == ((Point)obj).X && this.Y == ((Point)obj).Y;
                }
                else return base.Equals(obj);
            }
            public override int GetHashCode()
            {
                return X.GetHashCode() + Y.GetHashCode();
            }
        }
        public static void Main()
        {
            System.Text.StringBuilder res = new System.Text.StringBuilder();
            var tests = 1;
            //tests = readInt();
            for (int i = 0; i < tests; ++i)
            {
                res.AppendLine(Solve());
            }

            System.Console.Out.WriteLine(res);
        }

        static string Solve()
        {
            var x = readSplitedInts(' ').ToList<long>();

            long res = 0;
            x.RemoveAll(r => r == 0);

            while (x.Count > 1)
            {
                x.Sort();

                if (x.Count == 3)
                {
                    long length = x[2] - x[0];

                    if (length <= 1)
                    {
                        res += x[0];
                        break;
                    }
                    else
                    {
                        if (x[2] >= 2)
                        {
                            x[2] -= 2;
                            x[1] -= 1;
                            res++;
                            x.RemoveAll(r => r == 0);
                        }
                        else
                        {
                            res++;
                            break;
                        }
                    }
                }
                else
                {
                    res += System.Math.Min(x[0], x[1] / 2);
                    break;
                }

            }

            return res.ToString();
        }

        static long parseInt(string str)
        {
            int res = 0;
            for (int i = 0; i < str.Length; ++i)
            {
                res *= 10;
                switch (str[i])
                {
                    case '0':
                        res += 0;
                        break;
                    case '1':
                        res += 1;
                        break;
                    case '2':
                        res += 2;
                        break;
                    case '3':
                        res += 3;
                        break;
                    case '4':
                        res += 4;
                        break;
                    case '5':
                        res += 5;
                        break;
                    case '6':
                        res += 6;
                        break;
                    case '7':
                        res += 7;
                        break;
                    case '8':
                        res += 8;
                        break;
                    case '9':
                        res += 9;
                        break;
                }
            }
            if (str.StartsWith("-"))
            {
                res *= -1;
            }
            return res;
        }
        static long[] readSplitedInts(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            long[] res = new long[t.Length];
            for (int i = 0; i < t.Length; ++i)
            {
                res[i] = parseInt(t[i]);
            }
            return res;
        }
        static long readInt()
        {
            return parseInt(System.Console.In.ReadLine());
        }
        static string[] readSplited(char split)
        {
            var t = System.Console.In.ReadLine().Split(split);
            return t;
        }
    }
}

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

namespace Table_Decorations
{
    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)
        {
            var list = new List<long>();
            list.Add(Next());
            list.Add(Next());
            list.Add(Next());

            long count = 0;

            list.Sort();
            while (true)
            {
                if ((list[1] == 0 && list[0] == 0))
                    break;
                if (list.Sum() < 3)
                    break;

                long delta = list[2] - list[1];
                long delta1 = list[1] - list[0];

                if (delta1 == 0 && delta == 0)
                {
                    count += list[0];
                    list[1] -= list[0];
                    list[2] -= list[0];
                    list[0] -= list[0];
                }
                else if (delta1 == 0)
                {
                    long min = Math.Min(list[0], (delta + list[0])/4);
                    if (min == 0)
                    {
                    }
                    else
                    {
                        count += min*2;
                        list[1] -= min;
                        list[2] -= min*4;
                        list[0] -= min;
                    }
                }
                else
                {
                    long min = Math.Min(delta1, (delta + delta1)/2);
                    if (min == 0)
                    {
                        count += list[0];
                        list[1] -= list[0];
                        list[2] -= list[0];
                        list[0] -= list[0];
                    }
                    else
                    {
                        count += min;
                        list[1] -= min;
                        list[2] -= 2*min;
                    }
                }
                list.Sort();
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static long Next()
        {
            int c;
            long 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.IO;
using System.Linq;
using System.Text;

namespace Table_Decorations
{
    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)
        {
            var list = new List<long>();
            list.Add(Next());
            list.Add(Next());
            list.Add(Next());

            list.Sort();

            long count = list.Sum()/3;
            if (2*count < list[2])
            {
                count = list[0] + list[1];
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static long Next()
        {
            int c;
            long 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.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(File.OpenText("in.txt"));
            var data = Console.ReadLine().Split().Select(d => long.Parse(d)).ToArray();
            var r = data[0];
            var g = data[1];
            var b = data[2];

            var max = Math.Max(r, g);
            var min = Math.Min(r, g);
            long mid = 0;

            if (b >= max)
            {
                mid = max;
                max = b;
            }
            else if (b > min)
            {
                mid = b;
            }
            else if (b <= min)
            {
                mid = min;
                min = b;
            }

            long count = 0;
            var cicles = min / 2;
            var rem = min % 2;
            count += cicles * 2;

            max -= (cicles * 2);
            min -= (cicles * 2);
            mid -= (cicles * 2);

            cicles = mid / 3;

            mid -= (cicles * 3);
            max -= (cicles * 3);

            count += (cicles * 2);

            //rem = min;
            //cicles = mid / 2;

            //var res = Math.Min(rem, cicles);
            //count += res;
            //min -= res;
            //mid -= (res * 2);

            cicles = max / 2;
            rem = min;
            var res = Math.Min(rem, cicles);
            count += res;
            if (res > 0)
            {
                max -= cicles * 2;
                min -= res;
            }

            cicles = max / 2;
            rem = mid;
            res = Math.Min(rem, cicles);
            count += res;
            if (res > 0)
            {
                max -= cicles * 2;
                mid -= res;
            }

            cicles = mid / 2;
            rem = max;
            res = Math.Min(rem, cicles);
            count += res;
            if (res > 0)
            {
                mid -= cicles * 2;
                max -= res;
            }

            if (max == 1 && mid == 1 && min == 1)
            {
                count++;

            }

            //if (mid == 2 && min == 1 && cicles <= 1)
            //{

            //}

            //if (cicles > 0)
            //{
            //    if (mid > 0)
            //    {
            //        cicles--;
            //        mid--;
            //        max -= 2;
            //    }
            //    else if (min > 0)
            //    {
            //        cicles--;
            //        min--;
            //        min -= 2;
            //    }
            //}

            //rem = min + mid;

            //res = Math.Min(rem, cicles);
            //count += res;

            Console.WriteLine(count);
            //var count = min;

            //r -= min;
            //g -= min;
            //b -= min;

            //var a = r == 0 ? g : r;
            //var c = a == g ? b : (g == 0 ? b : g);
            //var diff = Math.Abs(a - c);
            //var abs = Math.Min(a, c);

            //var t = abs / 3;
            //var rem = abs % 3;

        }
    }
}

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

namespace _273c
{
	class Program
	{
		static void Main(string[] args)
		{
			//Console.SetIn(File.OpenText("in.txt"));
			var d = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
			//var r = d[0];
			//var g = d[1];
			//var b = d[2];

			//Array.Sort(d);
			//var max = d[2];
			//var mid = d[1];
			//var min = d[0];

			var count = 0;
			while (true)
			{
				Array.Sort(d);
				var max = d.Max();
				var min = d.Min();
				if (max - min <= 1)
				{
					break;
				}

				while (true)
				{
					Array.Sort(d);

					if (d[2] - d[1] <= 1)
					{
						var md = d[2] - d[0];
						var md2 = d[1] - d[0];
						var ml2 = Math.Min(d[2], d[1]);
						var mx = Math.Max(d[1], d[2]);
						var m1 = md / 3;
						var m2 = md2 / 3;
						var n2 = Math.Min(m1, m2);
						if (n2 != 0)
						{
							ml2 -= n2 * 3;
							mx -= n2 * 3;

							d[2] = mx;
							d[1] = ml2;
							count += n2 * 2;
							continue;
						}
					}
					//if (d[1] - d[0] <= 1)
					//{
					//	break;
					//}

					//var md = d[2] - d[0];
					//var md2 = d[1] - d[0];
					//var ml2 = Math.Min(d[2], d[1]);
					//var mx = Math.Max(d[2], d[1]);

					var cr = (d[2] - d[1]) / 2;
					var c = d[1] - d[0];
					//if (c == 0)
					//{
					//	break;
					//}

					var can = Math.Min(c, cr);
					if (can == 0)
					{
						break;
					}

					d[2] -= can * 2;
					d[1] -= can;

					count += can;
				}

				//for (int i = 0; i < c; i++)
				//{
				//	if (mx - 2 < d[0])
				//	{
				//		break;
				//	}

				//	mx -= 2;
				//	ml2 -= 1;
				//	count++;
				//}

				while (true)
				{
					Array.Sort(d);
					max = d.Max();
					min = d.Min();
					if (max - min <= 1)
					{
						break;
					}

					var need = (d[2] - d[0]) / 2;
					var av = d[0] + d[1];
					if (av == 0)
					{
						break;
					}

					var re = Math.Min(need, av);
					var split = re / 2;

					d[2] -= re * 2;
					d[1] -= split;
					d[0] -= split;
					if (re % 2 == 1)
					{
						d[1] -= 1;
					}

					count += re;

				}

				break;

			}

			var tor = d.Min();
			count += tor;
			Console.WriteLine(count);
		}

	}
}

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

namespace _273c
{
	class Program
	{
		static void Main(string[] args)
		{
			//Console.SetIn(File.OpenText("in.txt"));
			var d = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
			//var r = d[0];
			//var g = d[1];
			//var b = d[2];

			//Array.Sort(d);
			//var max = d[2];
			//var mid = d[1];
			//var min = d[0];

			var count = 0;
			while (true)
			{
				Array.Sort(d);
				var max = d.Max();
				var min = d.Min();
				if (max - min <= 1)
				{
					break;
				}

				var md = d[2] - d[0];
				var md2 = d[1] - d[0];
				var ml = Math.Min(md, md2);
				var cr3 = ml / 3;
				d[2] -= cr3 * 3;
				d[1] -= cr3 * 3;
				count += cr3 * 2;

				md = d[2] - d[0];
				md2 = d[1] - d[0];

				var ml2 = Math.Min(d[2], d[1]);
				var mx = Math.Max(d[2], d[1]);

				var c = d[1] - d[0];
				for (int i = 0; i < c; i++)
				{
					if (mx - 2 < d[0])
					{
						break;
					}

					mx -= 2;
					ml2 -= 1;
					count++;
				}

				d[2] = mx;
				d[1] = ml2;

				while (true)
				{
					Array.Sort(d);
					max = d.Max();
					min = d.Min();
					if (max - min <= 1)
					{
						break;
					}

					var need = (d[2] - d[0]) / 2;
					var av = d[0] + d[1];
					if (av == 0)
					{
						break;
					}

					var re = Math.Min(need, av);
					var split = re / 2;

					d[2] -= re * 2;
					d[1] -= split;
					d[0] -= split;
					if (re % 2 == 1)
					{
						d[1] -= 1;
					}

					count += re;

				}

				break;

			}

			var tor = d.Min();
			count += tor;
			Console.WriteLine(count);
		}

	}
}

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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(File.OpenText("in.txt"));
            var data = Console.ReadLine().Split().Select(d => long.Parse(d)).ToArray();
            var r = data[0];
            var g = data[1];
            var b = data[2];

            var max = Math.Max(r, g);
            var min = Math.Min(r, g);
            long mid = 0;

            if (b >= max)
            {
                mid = max;
                max = b;
            }
            else if (b > min)
            {
                mid = b;
            }
            else if (b <= min)
            {
                mid = min;
                min = b;
            }

            long count = 0;
            var cicles = min / 2;
            var rem = min % 2;
            count += cicles * 2;

            max -= (cicles * 2);
            min -= (cicles * 2);
            mid -= (cicles * 2);

            cicles = mid / 3;

            mid -= (cicles * 3);
            max -= (cicles * 3);

            count += (cicles * 2);

            //rem = min;
            //cicles = mid / 2;

            //var res = Math.Min(rem, cicles);
            //count += res;
            //min -= res;
            //mid -= (res * 2);

            cicles = max / 2;
            rem = min;
            var res = Math.Min(rem, cicles);
            count += res;
            max -= cicles * 2;
            min -= res;

            cicles = max / 2;
            rem = mid;
            res = Math.Min(rem, cicles);
            count += res;
            max -= cicles * 2;
            mid -= res;

            cicles = mid / 2;
            rem = max;
            res = Math.Min(rem, cicles);
            count += res;
            mid -= cicles * 2;
            max -= res;

            if (max == 1 && mid == 1 && min == 1)
            {
                count++;

            }

            //if (mid == 2 && min == 1 && cicles <= 1)
            //{

            //}

            //if (cicles > 0)
            //{
            //    if (mid > 0)
            //    {
            //        cicles--;
            //        mid--;
            //        max -= 2;
            //    }
            //    else if (min > 0)
            //    {
            //        cicles--;
            //        min--;
            //        min -= 2;
            //    }
            //}

            //rem = min + mid;

            //res = Math.Min(rem, cicles);
            //count += res;

            Console.WriteLine(count);
            //var count = min;

            //r -= min;
            //g -= min;
            //b -= min;

            //var a = r == 0 ? g : r;
            //var c = a == g ? b : (g == 0 ? b : g);
            //var diff = Math.Abs(a - c);
            //var abs = Math.Min(a, c);

            //var t = abs / 3;
            //var rem = abs % 3;

        }
    }
}

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

namespace CodeForces_273_C {
  class Program {
    static void Main(string[] args) {
      string[] astr = Console.ReadLine().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
      int[] aint = new int[astr.Length];
      int i = 0;
      foreach(string s in astr) {
        aint[i] = int.Parse(s);
        i++;
      }

      DateTime time1 = DateTime.Now;
      Array.Sort(aint);
      int k = Func1(aint);
      DateTime time2 = DateTime.Now;

      Console.WriteLine(k);
      Console.WriteLine((time2 - time1).TotalMilliseconds);
      Console.ReadLine();
    }

    private static int Func1(int[] arr) {
      int kMax = (int)(((long)arr[0] + arr[1] + arr[2]) / 3);
      if(kMax > arr[1] + arr[2]) kMax = arr[1] + arr[2];

      int k = 0;

      int kMin2 = 2 * arr[1] - arr[2];
      if(kMin2 > arr[0]) kMin2 = arr[0];
      if(kMin2 > 0) {
        arr[0] -= kMin2;
        arr[1] -= kMin2;
        arr[2] -= kMin2;
        k += kMin2;
      }
      int kMin = arr[0];

      while(true) {
        if(arr[1] == 0 || arr[2] == 0) break;
        if((long)arr[0] + arr[1] + arr[2] < 3) break;

        int tmp = 0;
        if(arr[0] > 0) {

          if((arr[2] - arr[1] / 3) >= arr[0] * 2) {
            tmp = arr[0];
          } else {
            tmp = (arr[2] - arr[1] / 3) / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[0] -= tmp;
            arr[2] -= tmp * 2;

            Array.Sort(arr);
            continue;
          }
        } else {
          if(arr[2] >= arr[1] * 2) {
            tmp = arr[1];
          } else {
            tmp = arr[2] / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[1] -= tmp;
            arr[2] -= tmp * 2;

            Array.Sort(arr);
            continue;
          }
        }

        arr[2] -= 2;
        if(arr[0] > 0) {
          arr[0] -= 1;
        } else {
          arr[1] -= 1;
        }

        if(arr[2] < arr[1]) {
          tmp = arr[2];
          arr[2] = arr[1];
          arr[1] = tmp;
        }

        k++;
      }

      return k;
    }
  }
}

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

namespace CodeForces_273_C {
  class Program {
    static void Main(string[] args) {
      string[] astr = Console.ReadLine().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
      int[] aint = new int[astr.Length];
      int i = 0;
      foreach(string s in astr) {
        aint[i] = int.Parse(s);
        i++;
      }
      Array.Sort(aint);

      int k = Func1(aint);

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

    private static int Func1(int[] arr) {
      int kMax = (arr[0] + arr[1] + arr[2]) / 3;
      if(kMax > arr[1] + arr[2]) kMax = arr[1] + arr[2];

      int k = 0;

      int kMin2 = 2 * arr[1] - arr[2];
      if(kMin2 > arr[0]) kMin2 = arr[0];
      if(kMin2 > 0) {
        arr[0] -= kMin2;
        arr[1] -= kMin2;
        arr[2] -= kMin2;
        k += kMin2;
      }
      int kMin = arr[0];

      while(true) {
        if(arr[1] == 0 || arr[2] == 0) break;
        if(arr[0] + arr[1] + arr[2] < 3) break;

        if(arr[0] > 0) {
          int tmp = 0;
          if(arr[2] >= arr[0] * 2) {
            tmp = arr[0];
          } else {
            tmp = arr[2] / 2;
          }
          k += tmp;
          arr[0] -= tmp;
          arr[2] -= tmp * 2;
          Array.Sort(arr);
          continue;
        }

        arr[2] -= 2;
        if(arr[0] > 0) {
          arr[0] -= 1;
        } else {
          arr[1] -= 1;
        }

        if(arr[2] < arr[1]) {
          int tmp = arr[2];
          arr[2] = arr[1];
          arr[1] = tmp;
        }

        k++;
      }

      return k;
    }
  }
}

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

namespace CodeForces_273_C {
  class Program {
    static void Main(string[] args) {
      string[] astr = Console.ReadLine().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
      int[] aint = new int[astr.Length];
      int i = 0;
      foreach(string s in astr) {
        aint[i] = int.Parse(s);
        i++;
      }
      Array.Sort(aint);

      int k = Func1(aint);

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

    private static int Func1(int[] arr) {
      int kMax = (arr[0] + arr[1] + arr[2]) / 3;
      if(kMax > arr[1] + arr[2]) kMax = arr[1] + arr[2];

      int k = 0;

      int kMin2 = 2 * arr[1] - arr[2];
      if(kMin2 > arr[0]) kMin2 = arr[0];
      if(kMin2 > 0) {
        arr[0] -= kMin2;
        arr[1] -= kMin2;
        arr[2] -= kMin2;
        k += kMin2;
      }
      int kMin = arr[0];

      while(true) {
        if(arr[1] == 0 || arr[2] == 0) break;
        if(arr[0] + arr[1] + arr[2] < 3) break;

        if(arr[0] > 0) {
          int tmp = 0;
          if((arr[2] - arr[1] / 2) >= arr[0] * 2) {
            tmp = arr[0];
          } else {
            tmp = (arr[2] - arr[1] / 2) / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[0] -= tmp;
            arr[2] -= tmp * 2;
            Array.Sort(arr);
            continue;
          }
        }

        arr[2] -= 2;
        if(arr[0] > 0) {
          arr[0] -= 1;
        } else {
          arr[1] -= 1;
        }

        if(arr[2] < arr[1]) {
          int tmp = arr[2];
          arr[2] = arr[1];
          arr[1] = tmp;
        }

        k++;
      }

      return k;
    }
  }
}

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

namespace CodeForces_273_C {
  class Program {
    static void Main(string[] args) {
      string[] astr = Console.ReadLine().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
      int[] aint = new int[astr.Length];
      int i = 0;
      foreach(string s in astr) {
        aint[i] = int.Parse(s);
        i++;
      }

      DateTime time1 = DateTime.Now;
      Array.Sort(aint);
      int k = Func1(aint);
      DateTime time2 = DateTime.Now;

      Console.WriteLine(k);
      //Console.WriteLine((time2 - time1).TotalMilliseconds);
      Console.ReadLine();
    }

    private static int Func1(int[] arr) {
      int kMax = (int)(((long)arr[0] + arr[1] + arr[2]) / 3);
      if(kMax > arr[1] + arr[2]) kMax = arr[1] + arr[2];

      int k = 0;

      int kMin2 = 2 * arr[1] - arr[2];
      if(kMin2 > arr[0]) kMin2 = arr[0];
      if(kMin2 > 0) {
        arr[0] -= kMin2;
        arr[1] -= kMin2;
        arr[2] -= kMin2;
        k += kMin2;
      }
      int kMin = arr[0];

      while(true) {
        if(arr[1] == 0 || arr[2] == 0) break;
        if((long)arr[0] + arr[1] + arr[2] < 3) break;

        int tmp = 0;
        if(arr[0] > 0) {

          if((arr[2] - arr[1] / 3) >= arr[0] * 2) {
            tmp = arr[0];
          } else {
            tmp = (arr[2] - arr[1] / 3) / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[0] -= tmp;
            arr[2] -= tmp * 2;

            Array.Sort(arr);
            continue;
          }
        } else {
          if(arr[2] >= arr[1] * 2) {
            tmp = arr[1];
          } else {
            tmp = arr[2] / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[1] -= tmp;
            arr[2] -= tmp * 2;

            Array.Sort(arr);
            continue;
          }
        }

        arr[2] -= 2;
        if(arr[0] > 0) {
          arr[0] -= 1;
        } else {
          arr[1] -= 1;
        }

        if(arr[2] < arr[1]) {
          tmp = arr[2];
          arr[2] = arr[1];
          arr[1] = tmp;
        }

        k++;
      }

      return k;
    }
  }
}

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

namespace CodeForces_273_C {
  class Program {
    static void Main(string[] args) {
      string[] astr = Console.ReadLine().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
      int[] aint = new int[astr.Length];
      int i = 0;
      foreach(string s in astr) {
        aint[i] = int.Parse(s);
        i++;
      }
      Array.Sort(aint);

      int k = Func1(aint);

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

    private static int Func1(int[] arr) {
      int kMax = (arr[0] + arr[1] + arr[2]) / 3;
      if(kMax > arr[1] + arr[2]) kMax = arr[1] + arr[2];

      int k = 0;

      int kMin2 = 2 * arr[1] - arr[2];
      if(kMin2 > arr[0]) kMin2 = arr[0];
      if(kMin2 > 0) {
        arr[0] -= kMin2;
        arr[1] -= kMin2;
        arr[2] -= kMin2;
        k += kMin2;
      }
      int kMin = arr[0];

      while(true) {
        if(arr[1] == 0 || arr[2] == 0) break;
        if(arr[0] + arr[1] + arr[2] < 3) break;

        if(arr[0] > 0) {
          if(arr[2] >= arr[0] * 2) {
            k += arr[0];
            arr[0] = 0;
            arr[2] -= 2 * arr[0];
            Array.Sort(arr);
            continue;
          } else {
            int tmp = arr[2] / 2;
            k += tmp;
            arr[0] -= tmp;
            arr[2] -= tmp * 2;
            Array.Sort(arr);
            continue;
          }
        }

        arr[2] -= 2;
        if(arr[0] > 0) {
          arr[0] -= 1;
        } else {
          arr[1] -= 1;
        }

        if(arr[2] < arr[1]) {
          int tmp = arr[2];
          arr[2] = arr[1];
          arr[1] = tmp;
        }

        k++;
      }

      return k;
    }
  }
}

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

namespace CodeForces_273_C {
  class Program {
    static void Main(string[] args) {
      string[] astr = Console.ReadLine().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
      int[] aint = new int[astr.Length];
      int i = 0;
      foreach(string s in astr) {
        aint[i] = int.Parse(s);
        i++;
      }

      DateTime time1 = DateTime.Now;
      Array.Sort(aint);
      int k = Func1(aint);
      DateTime time2 = DateTime.Now;

      Console.WriteLine(k);
      //Console.WriteLine((time2 - time1).TotalMilliseconds);
      Console.ReadLine();
    }

    private static int Func1(int[] arr) {
      int kMax = (int)(((long)arr[0] + arr[1] + arr[2]) / 3);
      if(kMax > arr[1] + arr[2]) kMax = arr[1] + arr[2];

      int k = 0;

      int kMin2 = 2 * arr[1] - arr[2];
      if(kMin2 > arr[0]) kMin2 = arr[0];
      if(kMin2 > 0) {
        arr[0] -= kMin2;
        arr[1] -= kMin2;
        arr[2] -= kMin2;
        k += kMin2;
      }
      int kMin = arr[0];

      while(true) {
        if(arr[1] == 0 || arr[2] == 0) break;
        if((long)arr[0] + arr[1] + arr[2] < 3) break;

        int tmp = 0;
        if(arr[0] > 0) {

          if((arr[2] - arr[1] / 3) >= arr[0] * 2) {
            tmp = arr[0];
          } else {
            tmp = (arr[2] - arr[1] / 3) / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[0] -= tmp;
            arr[2] -= tmp * 2;

            Array.Sort(arr);
            continue;
          }
        } else {
          if((arr[2] - arr[1] / 3) >= arr[1] * 2) {
            tmp = arr[1];
          } else {
            tmp = (arr[2] - arr[1] / 3) / 2;
          }
          if(tmp > 0) {
            k += tmp;
            arr[1] -= tmp;
            arr[2] -= tmp * 2;

            Array.Sort(arr);
            continue;
          }
        }

        arr[2] -= 2;
        if(arr[0] > 0) {
          arr[0] -= 1;
        } else {
          arr[1] -= 1;
        }

        if(arr[2] < arr[1]) {
          tmp = arr[2];
          arr[2] = arr[1];
          arr[1] = tmp;
        }

        k++;
      }

      return k;
    }
  }
}

using System;
using System.Linq;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        long[] num = Console.ReadLine().Trim().Split().Select(x => long.Parse(x)).ToArray();
        long min = num.Min();
        long total = min;
        num[0] = num[0] - min;
        num[1] = num[1] - min;
        num[2] = num[2] - min;
        Array.Sort(num);
        if(num[1] > 0 && num[2] > 0){
            min = Math.Max(num[1] , num[2]) / 2;
            total += Math.Min(min,Math.Min(num[1],num[2]));
        }
        Console.WriteLine(total);
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        long[] num = Console.ReadLine().Trim().Split().Select(x => long.Parse(x)).ToArray();
        long min = num.Min();
        long total = min;
        if(min == 2){
            Console.WriteLine(0);
            return;
        }
        num[0] = num[0] - min;
        num[1] = num[1] - min;
        num[2] = num[2] - min;
        Array.Sort(num);
        if(num[1] > 0 && num[2] > 0){
            min = Math.Max(num[1] , num[2]) / 2;
            min = Math.Min(min,Math.Min(num[1],num[2]));
            total += min;
            if(Math.Max(num[1] , num[2]) % 2 == 1 && (Math.Min(num[1],num[2])) - min > 1)
              total++;

        }
        Console.WriteLine(total);
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        long[] num = Console.ReadLine().Trim().Split().Select(x => long.Parse(x)).ToArray();
        long min = num.Min();
        long total = min;
        num[0] = num[0] - min;
        num[1] = num[1] - min;
        num[2] = num[2] - min;
        Array.Sort(num);
        if(num[1] > 0 && num[2] > 0){
            min = Math.Max(num[1] , num[2]) / 2;
            min = Math.Min(min,Math.Min(num[1],num[2]));
            total += min;
            if(Math.Max(num[1] , num[2]) % 2 == 1 && Math.Min(num[1],num[2]) - min > 1)
              total++;

        }
        Console.WriteLine(total);
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        long[] num = Console.ReadLine().Trim().Split().Select(x => long.Parse(x)).ToArray();
        long min = num.Min();
        long total = min;
        if(min <= 2){
            Console.WriteLine(0);
            return;
        }
        num[0] = num[0] - min;
        num[1] = num[1] - min;
        num[2] = num[2] - min;
        Array.Sort(num);
        if(num[1] > 0 && num[2] > 0){
            min = Math.Max(num[1] , num[2]) / 2;
            min = Math.Min(min,Math.Min(num[1],num[2]));
            total += min;
            if(Math.Max(num[1] , num[2]) % 2 == 1 && (Math.Min(num[1],num[2])) - min > 1)
              total++;

        }
        Console.WriteLine(total);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;
using System.Numerics;
using System.Globalization;
using System.Threading;

namespace probleme {
    class Program {
        static int[] v;
        static void read() {
            v = Array.ConvertAll(Console.ReadLine().Split(' '), ts => int.Parse(ts));
        }

        static int f() {
            Array.Sort(v);
            if (v[0] == v[1] && v[1] == v[2]) {
                return v[0];
            }
            v[1] -= 1;
            v[2] -= 2;
            return 1 + f();
        }

        static void solve() {
            read();

            int ans = f();
        }

        static void Main(string[] args) {

            //Console.SetIn(new StreamReader("file.in"));
            /*
            FileStream filestream = new FileStream("out.txt", FileMode.Create);
            var streamwriter = new StreamWriter(filestream);
            streamwriter.AutoFlush = true;
            Console.SetOut(streamwriter);
            */

            solve();

            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;
using System.Numerics;
using System.Globalization;
using System.Threading;

namespace probleme {
    class Program {
        static int[] v;
        static void read() {
            v = Array.ConvertAll(Console.ReadLine().Split(' '), ts => int.Parse(ts));
        }

        static void solve() {
            read();

            int ans = 0;
            Array.Sort(v);
            while (v[1] > 0 && v[2] > 1) {
                if ((v[0] == v[1]) && (v[1] == v[2])) {
                    ans += v[0];
                    v[1] = 0;
                }
                ans++;
                v[1]--;
                v[2] -= 2;
                Array.Sort(v);
            }
            Console.Write(ans);
        }

        static void Main(string[] args) {

            //Console.SetIn(new StreamReader("file.in"));
            /*
            FileStream filestream = new FileStream("out.txt", FileMode.Create);
            var streamwriter = new StreamWriter(filestream);
            streamwriter.AutoFlush = true;
            Console.SetOut(streamwriter);
            */

            solve();

           //Console.ReadKey();
        }
    }
}

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

namespace CF {
    class Program {
        static int[] a;

        static void solve()
        {
            a = Array.ConvertAll(Console.ReadLine().Split(), ts => int.Parse(ts));
            Array.Sort(a);
            if (a[0] + a[1] < a[2]/2)
            {
                Console.Write(a[0] + a[1]);
            } else
            {
                Console.Write((a[0] + a[1] + a[2]) / 3);
            }
        }

        static void Main( string[ ] args ) {
            //Console.SetIn(new StreamReader("in.txt"));

            solve( );
        }
    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

         //   Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = (max + av) / 3;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

         //   Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

       //      Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

           //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
               // Console.WriteLine("here in the if   "+newav);
            }
            else if ((max + av) / 3 > av && max<oldav*3)
            {
                newav = (max + av) / 3;

               // reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = av;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

            //Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

             //Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = re;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

    //        Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = (max + av) / 3;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

  //          Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

//             Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

             //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

            // max = max - min;
            // av = av - min;
            // int newmax = max - av;
            // int newav = 0, reminder = 0;
            // if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            // {
            //     newav = (max + av) / 3;
            //     reminder = (max + av) % 3;

            // }
            // else if ((max + av) / 3 > av && max<oldav*3)
            // {
            //     newav = (max + av) / 3;
            //     //Console.WriteLine("here in the first ");
            //     // reminder = (max + av) % 3;
            // }

            // else if ((max + av) / 3 > av && max < av * 3)
            // {
            //     newav = av;

            //    // Console.WriteLine("here in the sec ");
            // }
            // else if ((max + av) / 3 > av )
            // {
            //     newav = (max + av) / 3;

            //     //Console.WriteLine("here in the third ");
            //     // reminder = (max + av) % 3;
            // }

            // int output = min + newav;
            //// if (reminder > 3 || (max + av) / 3 > av)
            //  //   output++;

            //// Console.WriteLine(" new averaf  "+newav);
            // //Console.WriteLine(output);

            long sum = 0;
                sum=(min + av );
            sum += max;
            long temp = (sum / 3);

            sum = temp;

            if (sum < min)
                Console.WriteLine(sum);
            else
                Console.WriteLine(min);
           //  Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

          // Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;

            }
            else if ((max + av) / 3 > av && max<oldav*3)
            {
                newav = (max + av) / 3;

                // reminder = (max + av) % 3;
            }

            else if ((max + av) / 3 > av)
            {
                newav = av;
            }
            else if ((max + av) / 3 > av )
            {
                newav = (max + av) / 3;

                // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

           // Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;

            // get the av
            int av = gr;
            if (gr <= bl && bl <= re)
                av = bl;
            else if (gr <= re && re <= bl)
                av = re;

            // get the max
            int max = gr;
            if (gr <= bl && bl >= re)
                max = bl;
            else if (gr <= re && re >= bl)
                max = re;

            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0,reminder=0;
          //  Console.WriteLine("the avar " +av+"   max  "+max);
            if ((max + av) / 3 <= av&& (max + av) / 3>0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }

            int output = min + newav;
            //Console.WriteLine(output);
            if (reminder > 3)
                output++;
           // Console.WriteLine(reminder);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

          // Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;

            }
            else if ((max + av) / 3 > av && max<oldav*3)
            {
                newav = (max + av) / 3;
                //Console.WriteLine("here in the first ");
                // reminder = (max + av) % 3;
            }

            else if ((max + av) / 3 > av && max < av * 3)
            {
                newav = av;

               // Console.WriteLine("here in the sec ");
            }
            else if ((max + av) / 3 > av )
            {
                newav = (max + av) / 3;

                //Console.WriteLine("here in the third ");
                // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

           // Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;

            // get the av
            int av = gr;
            if (min <= bl && bl >= re)
                av = bl;
            else if (min <= re && re >= bl)
                av = re;

            // get the max
            int max = gr;
            if (gr <= bl && bl >= re)
                max = bl;
            else if (gr <= re && re >= bl)
                max = re;

            //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = 1;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
            if (reminder > 3 || (max + av) / 3 > av)
                output++;

          //  Console.WriteLine(reminder);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

     //       Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av)
            {
                newav = (max + av) / 3;

               // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

          //  Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

          //   Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

             //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

            // max = max - min;
            // av = av - min;
            // int newmax = max - av;
            // int newav = 0, reminder = 0;
            // if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            // {
            //     newav = (max + av) / 3;
            //     reminder = (max + av) % 3;

            // }
            // else if ((max + av) / 3 > av && max<oldav*3)
            // {
            //     newav = (max + av) / 3;
            //     //Console.WriteLine("here in the first ");
            //     // reminder = (max + av) % 3;
            // }

            // else if ((max + av) / 3 > av && max < av * 3)
            // {
            //     newav = av;

            //    // Console.WriteLine("here in the sec ");
            // }
            // else if ((max + av) / 3 > av )
            // {
            //     newav = (max + av) / 3;

            //     //Console.WriteLine("here in the third ");
            //     // reminder = (max + av) % 3;
            // }

            // int output = min + newav;
            //// if (reminder > 3 || (max + av) / 3 > av)
            //  //   output++;

            //// Console.WriteLine(" new averaf  "+newav);
            // //Console.WriteLine(output);

            long sum = 0;
                sum=(min + av );
            sum += max;
            long temp = (sum / 3);

            //sum = temp;

            if (temp < (sum - max))
                Console.WriteLine(temp);
            else
                Console.WriteLine(sum-max);
             //Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

          // Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;

            }
            else if ((max + av) / 3 > av && max<oldav*3)
            {
                newav = (max + av) / 3;
                //Console.WriteLine("here in the first ");
                // reminder = (max + av) % 3;
            }

            else if ((max + av) / 3 > av && max < av * 3)
            {
                newav = av;

               // Console.WriteLine("here in the sec ");
            }
            else if ((max + av) / 3 > av )
            {
                newav = (max + av) / 3;

                //Console.WriteLine("here in the third ");
                // reminder = (max + av) % 3;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

           // Console.WriteLine(" new averaf  "+newav);
            //Console.WriteLine(output);

            int sum = gr + bl + re;
            sum = sum / 3;

            if (sum < max)
                Console.WriteLine(sum);
            else
                Console.WriteLine(max);
            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {
        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

           //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);
            max = max - min;
            av = av - min;
            int newmax = max - av;
            int newav = 0, reminder = 0;
            if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            {
                newav = (max + av) / 3;
                reminder = (max + av) % 3;
               // Console.WriteLine("here in the if   "+newav);
            }
            else if ((max + av) / 3 > av && max<oldav*3)
            {
                newav = (max + av) / 3;

                // reminder = (max + av) % 3;
            }
            else if ((max + av) / 3 > av )
            {
                newav = (max + av) / 3;

                // reminder = (max + av) % 3;
            }

            else if ((max + av) / 3 > av)
            {
                newav = av;
            }

            int output = min + newav;
           // if (reminder > 3 || (max + av) / 3 > av)
             //   output++;

            //Console.WriteLine(" new averaf  "+newav);
            Console.WriteLine(output);

            // Console.ReadKey();

        }

    }
}

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

namespace threeballon
{
    class Program
    {

        static void Main(string[] args)
        {
            // in put the number of games

            string[] tokens = Console.ReadLine().Split();

            //Parse element 0

            int gr = int.Parse(tokens[0]);

            int bl = int.Parse(tokens[1]);

            int re = int.Parse(tokens[2]);

            // get the minmum

            int min = gr;
            if (gr > bl && bl < re)
            {
                min = bl;
            }
            else if (gr > re && re < bl)
                min = re;
            // get the max
                int max = gr;
                if (gr <= bl && bl >= re)
                    max = bl;
                else if (gr <= re && re >= bl)
                    max = re;

            // get the av
            int av = gr;
            if (bl > min && bl < max)
                av = bl;
            else if (re > min && re < max)
                av = re;

            else if (re == gr && gr == bl)
                av = gr;
            else if (gr == min && bl == gr && gr > 0)
                av = gr;
            else if (bl == min && re == bl && re > 0)
                av = re;
            else if (re == min && gr == re && re > 0)
                av = gr;
            else if (gr == 0 && bl > 0 && re == max)
                av = bl;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;
            else if (bl == 0 && gr > 0 && re == max)
                av = gr;

            int oldav = av;

             //Console.WriteLine("the avar " + av + "   max  " + max+"   min is "+min);

            //if (gr != min && min < gr && gr < max && gr > 0)
            //    av = gr;
            //else if (bl != min && min < bl && bl < max && bl > 0)
            //    av = bl;
            //else if (re != min && min < re && re < max && re > 0)
            //    av = re;
            //else if (min <= bl && bl <= max)
            //    av = bl;
            //else if (min <= re && re <= max)
            //    av = re;
            //else if (min <= gr && gr <= max)
            //    av = gr;

            // max = max - min;
            // av = av - min;
            // int newmax = max - av;
            // int newav = 0, reminder = 0;
            // if ((max + av) / 3 <= av && (max + av) / 3 > 0)
            // {
            //     newav = (max + av) / 3;
            //     reminder = (max + av) % 3;

            // }
            // else if ((max + av) / 3 > av && max<oldav*3)
            // {
            //     newav = (max + av) / 3;
            //     //Console.WriteLine("here in the first ");
            //     // reminder = (max + av) % 3;
            // }

            // else if ((max + av) / 3 > av && max < av * 3)
            // {
            //     newav = av;

            //    // Console.WriteLine("here in the sec ");
            // }
            // else if ((max + av) / 3 > av )
            // {
            //     newav = (max + av) / 3;

            //     //Console.WriteLine("here in the third ");
            //     // reminder = (max + av) % 3;
            // }

            // int output = min + newav;
            //// if (reminder > 3 || (max + av) / 3 > av)
            //  //   output++;

            //// Console.WriteLine(" new averaf  "+newav);
            // //Console.WriteLine(output);

            long sum = 0;
                sum=(min + av );
            sum = (sum+max);

           // Console.WriteLine(" here el sum  " + sum);
            long temp = (sum / 3);

//            v = map(int, raw_input().split())
//s = sum(v); print min(s/ 3,s - max(v))

            //sum = temp;
            long temp1 = (sum - max);
            if (temp < temp1)
                Console.WriteLine(temp);
            else
                Console.WriteLine(temp1);
             //Console.ReadKey();

        }

    }
}