Fox Ciel has some flowers: r red flowers, g green flowers and b blue flowers. She wants to use these flowers to make several bouquets. There are 4 types of bouquets:  To make a "red bouquet", it needs 3 red flowers.  To make a "green bouquet", it needs 3 green flowers.  To make a "blue bouquet", it needs 3 blue flowers.  To make a "mixing bouquet", it needs 1 red, 1 green and 1 blue flower. Help Fox Ciel to find the maximal number of bouquets she can make.

The first line contains three integers r, g and b (0 ≤ r, g, b ≤ 109) — the number of red, green and blue flowers.

Print the maximal number of bouquets Fox Ciel can make.

NoteIn test case 1, we can make 1 red bouquet, 2 green bouquets and 3 blue bouquets.In test case 2, we can make 1 red, 1 green, 1 blue and 1 mixing bouquet.

using System;
using System.Linq;

namespace CSharp
{
    class _322B
    {
        public static void Main()
        {
            var flowers = Console.ReadLine().Split().Select(token => long.Parse(token)).ToArray();
            var remainders = flowers.Select(count => count % 3).OrderBy(r => r).ToArray();

            if (remainders.Distinct().Count() == 1)
            {
                Console.WriteLine(flowers.Sum() / 3);
            }
            else if (remainders[1] == 2)
            {
                Console.WriteLine(Math.Sign(flowers.First(count => count % 3 == 0)) + flowers.Sum(count => count / 3));
            }
            else if (remainders[0] == 0)
            {
                Console.WriteLine(flowers.Sum(count => count / 3));
            }
            else
            {
                Console.WriteLine(flowers.Sum() / 3);
            }
        }
    }
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			var mod = red % 3;
			if (mod == 0)
			{
				if (red > 0)
				{
					result += (red / 3) - 1;
					red = 3;
				}
			}
			else
			{
				result += red / 3;
				red = red % 3;
			}

			mod = green % 3;
			if (mod == 0)
			{
				if (green > 0)
				{
					result += (green / 3) - 1;
					green = 3;
				}
			}
			else
			{
				result += green / 3;
				green = green % 3;
			}

			mod = blue % 3;
			if (mod == 0)
			{
				if (blue > 0)
				{
					result += (blue / 3) - 1;
					blue = 3;
				}
			}
			else
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			if (min == 3)
			{
				result += 3;
			}
			else if (min == 2 || (min == 1 && red + green + blue >= 7) || (min == 0 && red + green + blue >= 6))
			{
				result += 2;
			}
			else if(min == 1 || (red == 3 || green == 3 || blue == 3))
			{
				result++;
			}
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace olimp
{

    class Node
    {
        public List<Node> Roads;
        public List<Node> ClosedRoads;
        public int Id,Mark;
    }

    static class Program
    {
        private static void Main()
        {
            string[] s =  Console.ReadLine().Split(' ');
            int[] a = new[]{ int.Parse(s[0]), int.Parse(s[1]), int.Parse(s[2]) };
            Array.Sort(a);
            int r, g, b;
            r = a[0];
            g = a[1];
            b = a[2];
            int ans = r + (g-r)/3 + (b-r)/3;
            int ans2 = b / 3 + g / 3 + Math.Min(r, Math.Min(b % 3, g % 3)) + (r - Math.Min(r, Math.Min(b % 3, g % 3)))/3;
            ans = Math.Max(ans, ans2);
            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static void ReadIntPair(out int a1, out int a2)
        {
            string[] s = Console.ReadLine().Split(' ');
            a1 = int.Parse(s[0]);
            a2 = int.Parse(s[1]);
        }

        static long ReadNextInt()
        {
            char c;
            StringBuilder builder = new StringBuilder(4);
            while (char.IsDigit(c = (char) Console.Read()) || c == '-'||c == '\r' || c == '\n')
            {
                if (c == '\r' || c == '\n')
                    continue;
                builder.Append(c);
            }
            return long.Parse(builder.ToString());
        }

        static int Sum1(int n)
        {
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += (int)(Math.Pow(-1, i)*Math.Pow(n - i, 2));
            }
            return sum;
        }

        static int Sum2(int n)
        {
            return (n*(n+1))/2;
        }

        static double Log10(double x)
        {
            int n = CalnN((int) x);
            double val = n;
            double last = x;
            for (int i = 1; i <= sizeof(double) * 8; i++)
            {
                last = last*last;
                if (last >= 10)
                {
                    val += 1/Math.Pow(2, i);
                    last /= 10;
                }
            }
            return val;
        }

        static int CalnN(int x)
        {
            int i = 0;
            for (; Math.Pow(x, i + 1) < x; i++)
            {
            }
            return i;
        }
    }
}

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

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            Console.SetIn(new System.IO.StreamReader(@"..\..\..\in"));
            Console.SetOut(new System.IO.StreamWriter(@"..\..\..\out"));
            for (int testN = 0; testN < 4; testN++)
            {
#endif
                //SetCulture();
                var r = NextInt();
                var g = NextInt();
                var b = NextInt();
                int m = Math.Min(r, Math.Min(g, b));

                long res = m;
                r -= m;
                g -= m;
                b -= m;
                res += r / 3;
                res += g / 3;
                res += b / 3;
                int rr = r % 3;
                int rg = g % 3;
                int rb = b % 3;
                if (m > 0)
                {
                    if ((rr == 2 && rg == 2) || (rr == 2 && rb == 2) || (rb == 2 && rg == 2))
                    {
                        res += 1;
                    }
                }
                Console.WriteLine(res);
                //Console.WriteLine(string.Format(NumberFormatInfo.InvariantInfo, "{0:F4}", res));
#if !ONLINE_JUDGE
                Console.ReadLine();
            }
            Console.In.Close();
            Console.Out.Close();
#endif
        }

        private static char[] _defaultSplitter = new char[] { ' ', '\t' };

        private static void SetCulture()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        }

        private static char[] ReadChars(int n)
        {
            char[] buffer = new char[n];
            Console.In.ReadBlock(buffer, 0, n);
            return buffer;
        }

        private static string[] ReadAll()
        {
            return Console.In.ReadToEnd().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords()
        {
            return ReadWords(_defaultSplitter);
        }

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

        private static int[] ReadInts(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        private static int[] ReadInts()
        {
            return ReadInts(_defaultSplitter);
        }

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

        private static double ReadDouble()
        {
            return double.Parse(Console.ReadLine(), NumberFormatInfo.InvariantInfo);
        }

        private static int _pos = 0;
        private static string[] _inputLine = new string[0];

        private static void CheckInputLine()
        {
            if (_pos >= _inputLine.Length)
            {
                _inputLine = ReadWords();
                _pos = 0;
            }
        }

        private static string NextWord()
        {
            CheckInputLine();
            return _inputLine[_pos++];
        }

        private static int NextInt()
        {
            CheckInputLine();
            return int.Parse(_inputLine[_pos++]);
        }

        private static long NextLong()
        {
            CheckInputLine();
            return long.Parse(_inputLine[_pos++]);
        }
    }
}

using System;
using System.Linq;

namespace CielAndFlowers
{
    class CielAndFlowers
    {
        static void Main(string[] args)
        {
            int[] values = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] mix = new int[3];

            Array.Sort(values);

            for (int i = 0; i < 3; i++)
                mix[0] += values[i] / 3;

            if (values[0] > 0)
            {
                mix[1] = 1;

                for (int i = 0; i < 3; i++)
                    mix[1] += (values[i] - 1) / 3;
            }

            if (values[0] > 1)
            {
                mix[2] = 2;

                for (int i = 0; i < 3; i++)
                    mix[2] += (values[i] - 2) / 3;
            }

            Console.WriteLine(mix.Max());
        }
    }
}

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

class ProblemB
{
    static void Main()
    {
        var s = Console.ReadLine().Split(' ');
        var r = int.Parse(s[0]);
        var g = int.Parse(s[1]);
        var b = int.Parse(s[2]);

        var l = r/3;
        var m = g/3;
        var n = b/3;

        var x = r % 3;
        var y = g % 3;
        var z = b % 3;
        int[] array = { x, y, z };
        var min = 0;
        if (x == 2 && y == 2 && z == 2)
            min += 2;
        else if (x == 2 && y == 2 && n > 0)
        {
            min += 2;
            n--;
        }
        else if (x == 2 && z == 2 && m > 0)
        {
            min += 2;
            m--;
        }
        else if (y == 2 && z == 2 && l > 0)
        {
            min += 2;
            l--;
        }
        else min += array.Min();
        var num = l + m + n + min;
        Console.WriteLine(num.ToString());
    }
}

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

namespace ConsoleApplication27
{
    class Program
    {
        static void Main0(string[] args)
        {
            string[] line = Console.ReadLine().Split();
            int n = int.Parse(line[0]);
            int m = int.Parse(line[1]);

            Console.WriteLine(n + m - 1);
            Console.WriteLine("1 1");
            for (int i = 1; i < n; i++)
                Console.WriteLine("{0} 1", i + 1);
            for (int i = 1; i < m; i++)
                Console.WriteLine("1 {0}", i + 1);
        }

        static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split();
            int r = int.Parse(line[0]);
            int g = int.Parse(line[1]);
            int b = int.Parse(line[2]);

            int best = 0;
            for (int m = 0; m < 3; m++)
            {
                if (r < m || g < m || b < m)
                    continue;
                best = Math.Max(best, m + (r - m) / 3 + (g - m) / 3 + (b - m) / 3);
            }

            Console.WriteLine(best);
        }
    }
}

using System;
using System.Linq;
class Demo
{
    static void Main()
    {
        long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long r = a[0], ans = 0;
        long g = a[1];
        long b = a[2];
        a[0] = r % 3; a[1] = g % 3; a[2] = b % 3;
        bool flag = (a.Count(x => x > 1) > 1) && (r != 0 && g != 00 && b != 00);
        if (flag)
        {
            ans = 2;
            r -= 2;
            g -= 2;
            b -= 2;
        }
        ans += r / 3 + g / 3 + b / 3;
        if (!flag) ans += a.Min();
        Console.WriteLine(ans);
    }
}

using System; using System.Linq;

class P {
  static void Main() {
    var c = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    var v = Enumerable.Range(0,4).Select(x => c.Min() - x).Where(x => x >= 0)
              .Select(k => k + c.Select(r => (r-k)/3).Sum()).Max();
    Console.WriteLine(v);
  }
}

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

namespace _322_B
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string[] values = input.Split(' ');
            int r = Int32.Parse(values[0]);
            int g = Int32.Parse(values[1]);
            int b = Int32.Parse(values[2]);

            int total = 0;

            int min = Math.Min(Math.Min(r, g), b);
            if (min > 3) { min = 3; }

            // Пытаемся выравнять до такой степени, что количество как минимум двух типов цветов было кратно 3

            for (int j = 0; j < min; j++)
            {
                if ((r % 3 == 0 && b % 3 == 0) || (r % 3 == 0 && g % 3 == 0) || (b % 3 == 0 && g % 3 == 0))
                {
                    break;
                }
                r--; g--; b--; total++;
            }
            total += r / 3 + g / 3 + b / 3;

            Console.Write("{0}", total);
        }
    }
}

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

namespace Ciel_and_Flowers
{
    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)
        {
            int r = Next();
            int g = Next();
            int b = Next();

            int count = r/3 + g/3 + b/3;

            var nn = new[] {r%3, g%3, b%3};
            int min = nn.Min();

            if (min > 0)
            {
                count += min;
            }
            else
            {
                if (nn.Sum() == 4)
                {
                    if (r%3 == 0 && r > 0 || g%3 == 0 && g > 0 || b%3 == 0 && b > 0)
                    {
                        count++;
                    }
                }
            }

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

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

using System;

namespace Flowers
{
    class Flowers
    {
        static void Main(string[] args)
        {
            string[] rgb = Console.ReadLine().Split(' ');
            long r = long.Parse(rgb[0]);
            long g = long.Parse(rgb[1]);
            long b = long.Parse(rgb[2]);

            long rm = r % 3;
            long gm = g % 3;
            long bm = b % 3;
            if (rm == 0 && r > 0) rm = 3;
            if (gm == 0 && g > 0) gm = 3;
            if (bm == 0 && b > 0) bm = 3;

            long f = (r - rm) / 3 + (g - gm) / 3 + (b - bm) / 3;

            long min = Math.Min(rm, Math.Min(bm, gm));
            long thr = (rm == 3 ? 1 : 0) + (gm == 3 ? 1 : 0) + (bm == 3 ? 1 : 0);
            f += Math.Max(min, thr);

            Console.WriteLine(f);
        }
    }
}

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var j = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
            int a = j.ElementAt(0);
            int b = j.ElementAt(1);
            int c = j.ElementAt(2);
            int ans = a / 3 + b / 3 + c / 3;
            if ((a > 0) && (b > 0) && (c > 0))
            {
                ans=Math.Max(ans,(a-1)/3+(b-1)/3+(c-1)/3+1);
            }
            if ((a > 1) && (b > 1) && (c > 1))
            {
                ans=Math.Max(ans,(a-2)/3+(b-2)/3+(c-2)/3+2);
            }
            Console.WriteLine(ans);

        }
    }
}

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

namespace CodeForces
{
    class R190_Div2_B
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int rr = int.Parse(s[0]);
            int gg = int.Parse(s[1]);
            int bb = int.Parse(s[2]);

            int r, g, b;
            int cnt = 0;
            if (rr % 3 == 0 && rr > 0)
            {
                r = rr / 3 - 1;
                rr -= r * 3;
                cnt += r;
            }
            else
            {
                r = rr / 3;
                rr = rr % 3;
                cnt += r;
            }

            if (gg % 3 == 0 && gg > 0)
            {
                g = gg / 3 - 1;
                gg -= g * 3;
                cnt += g;
            }
            else
            {
                g = gg / 3;
                gg = gg % 3;
                cnt += g;
            }

            if (bb % 3 == 0 && bb > 0)
            {
                b = bb / 3 - 1;
                bb -= b * 3;
                cnt += b;
            }
            else
            {
                b = bb / 3;
                bb = bb % 3;
                cnt += b;
            }

            r = rr; g = gg; b = bb;
            int cnt1 = 0;
            cnt1 += Math.Min(r, Math.Min(g, b));
            r -= cnt1; g -= cnt1; b -= cnt1;
            cnt1 += r / 3 + g / 3 + b / 3;
            cnt1 += cnt;

            r = rr; g = gg; b = bb;
            int cnt2 = 0;
            cnt2 += r / 3; r = r % 3;
            cnt2 += g / 3; g = g % 3;
            cnt2 += b / 3; b = b % 3;

            cnt2 += Math.Min(r, Math.Min(g, b));
            cnt2 += cnt;

            Console.WriteLine(Math.Max(cnt1,cnt2));
        }
    }
}

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

public class taskB
{
    public class MyReader
    {
        private TextReader instream;

        public int[] ReadIntArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            int[] a = new int[spl.Length];
            for (int i = 0; i < a.Length; i++)
                a[i] = int.Parse(spl[i]);
            return a;
        }

        public long[] ReadLongArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            long[] a = new long[spl.Length];
            for (int i = 0; i < a.Length; i++)
                a[i] = long.Parse(spl[i]);
            return a;
        }

        public double[] ReadDoubleArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            double[] a = new double[spl.Length];

            System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
            nfi.NumberDecimalSeparator = ".";
            for (int i = 0; i < a.Length; i++)
                a[i] = double.Parse(spl[i], nfi);
            return a;
        }

        public int ReadInt()
        {
            return int.Parse(instream.ReadLine());
        }

        public long ReadLong()
        {
            return long.Parse(instream.ReadLine());
        }

        public void SetInStream(TextReader textReader)
        {
            this.instream = textReader;
        }

        internal string ReadLine()
        {
            return instream.ReadLine();
        }
    }

    static void Main(string[] args)
    {
        MyReader instream = new MyReader();
        instream.SetInStream(Console.In);

        TextWriter outstream = Console.Out;

        solve(instream, outstream);

    }

    private static void solve(MyReader instream, TextWriter outstream)
    {
        int[] rgb = instream.ReadIntArray();

        int minMin = Math.Min(Math.Min(rgb[0], rgb[1]), rgb[2]);

        int res = 0;

        for (int min = Math.Max(0, minMin - 4); min <= minMin; min++)
        {
            int subres = min;

            for (int i = 0; i < 3; i++)
            {
                subres += ((rgb[i] - min) / 3);
            }

            res = Math.Max(subres, res);
        }

        outstream.WriteLine(res);
    }

}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string in_s = Console.ReadLine();
            string[] pra = in_s.Split(' ');
            int redNum = Convert.ToInt32(pra[0]);
            int greenNum = Convert.ToInt32(pra[1]);
            int yellowNum = Convert.ToInt32(pra[2]);
            int ans = 0;
            for (int i = 0; i <= 2; i++)
            {
                int slo = i;
                slo += (redNum - i) / 3;
                slo += (greenNum - i) / 3;
                slo += (yellowNum - i) / 3;

                if (slo > ans && i <= redNum && i <= greenNum && i <= yellowNum)  ans = slo;
            }
            Console.WriteLine(ans);

        }
    }
}

using System;
using System.Linq;

class Program
{
    static double distance(int x1, int y1, int x2, int y2)
    {
        return 0.0;
    }

    static void Main()
    {
        string str = Console.ReadLine();
        var data = str.Split(new char[] { ' ' });

        int[] rgb = new int[3];

        rgb[0] = int.Parse(data[0]);
        rgb[1] = int.Parse(data[1]);
        rgb[2] = int.Parse(data[2]);

        int min = rgb.Min();
        int result = 0;

        for (int i = min; i > min - 3 && i >= 0; i--)
        {
            int buckets = i + (rgb[0] - i) / 3 + (rgb[1] - i) / 3 + (rgb[2] - i) / 3;

            if (result < buckets) result = buckets;
        }

        Console.WriteLine("{0}", result);
    }
}

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

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            int r, g, b;
            string[] s = Console.ReadLine().Split();
            r = int.Parse(s[0]);
            g = int.Parse(s[1]);
            b = int.Parse(s[2]);
            int maxx = 0;
            for (int mixed = 0; mixed <= Math.Min(Math.Min(2,r),Math.Min(b,g)); mixed++)
            {
                if (mixed + (r - mixed) / 3 + (g - mixed) / 3 + (b - mixed) / 3 > maxx)
                    maxx = mixed + (r - mixed) / 3 + (g - mixed) / 3 + (b - mixed) / 3;
            }
            Console.WriteLine(maxx.ToString());
        }
    }
}

using System;
using System.Linq;

class P
{
    static void Main()
    {
        var c = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        var v = Enumerable.Range(0, 4).Select(x => c.Min() - x).Where(x => x >= 0)
                  .Select(k => k + c.Select(r => (r - k) / 3).Sum()).Max();
        Console.WriteLine(v);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;

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

		public class Pair
		{
			public long First;

			public long 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<int> Edges;
		}

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

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		public static Dictionary<long, long> mp = new Dictionary<long, long>();
		public static long Go(long u, long v, long w)
		{
			long ans = 0;
			while (u != v)
				if (u > v)
				{
					if (!mp.ContainsKey(u))
						mp.Add(u, 0);
					ans += mp[u];
					mp[u] += w;
					u /= 2;
				}
				else
				{
					if (!mp.ContainsKey(v))
						mp.Add(v, 0);
					ans += mp[v];
					mp[v] += w;
					v /= 2;
				}
			return ans;
		}

		private static void Main()
		{
			var l = ReadListOfLongs();
			var r = l[0];
			var g = l[1];
			var b = l[2];
			long ans = 0;
			for (var i = 0; i < 3; ++i)
			{
				if (i <= Math.Min(r, Math.Min(g, b)))
				{
					var cur = i + (r - i) / 3 + (b - i) / 3 + (g - i) / 3;
					ans = Math.Max(cur, ans);
				}
			}
			Console.WriteLine(ans);
			Console.ReadLine();
		}
	}
}

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

namespace MakeCalendar
{
    public static class MainClass
    {

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

        static void ReadInt(ref int a)
        {
            a = ReadIntArrayLine()[0];
        }

        static void ReadInts(ref int a, ref int b)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1];
        }

        static void ReadInts(ref int a, ref int b, ref int c)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3]; e = x[4];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e, ref int f)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3]; e = x[4]; f = x[5];
        }

        static int[] ReadIntArrayLine()
        {
            char[] sep = { ' ' };
            return Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        static void PrintLn(object obj)
        {
            Console.WriteLine(obj.ToString());
        }

        public static string Reverse(string s)
        {
            char[] charArray = s.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }

        public static void PrintLnCollection<T>(IEnumerable<T> col)
        {
            PrintLn(string.Join(" ", col));
        }

        public static void PrintLn(params object[] v)
        {
            PrintLnCollection(v);
        }

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

        public static string MySubstring(this string str, int start, int finish)
        {
            if (start > finish) return "";
            return str.Substring(start, finish - start + 1);
        }

        public static bool IsInRange(this int a, int lb, int ub)
        {
            return (a >= lb) && (a <= ub);
        }

        private static void mergeDS(int i, int j, int[] a)
        {
            int t = a[j];
            for (int ii = 0; ii < a.Length; ii++)
            {
                if (a[ii] == t)
                    a[ii] = a[i];
            }
        }

        private static T MyMax<T>(params T[] a)
        {
            return a.Max();
        }

        private static T MyMin<T>(params T[] a)
        {
            return a.Min();
        }

        private static int[] GetPrimesLessThan(int x)
        {
            if (x < 2)
                return new int[0];

            int[] a = new int[x];

            a[0] = 1; a[1] = 1;

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == 0)
                    for (int j = 2 * i; j < a.Length; j += i)
                    {
                        a[j] = 1;
                    }
            }

            var abc = new List<int>(x);

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == 0)
                    abc.Add(i);
            }

            return abc.ToArray();
        }

        private static int FindNearestLEQElementInTheArray(int[] a, int startIndex, int endIndex, int target)
        {
            if (startIndex == endIndex)
            {
                if (a[startIndex] <= target)
                    return startIndex;
                else
                    return -1;
            }

            if (startIndex + 1 == endIndex)
            {
                if (a[endIndex] <= target)
                    return endIndex;
                else if (a[startIndex] <= target)
                    return startIndex;
                else
                    return -1;
            }

            int mid = (startIndex + endIndex) / 2;
            if (target == a[mid])
                return mid;
            else if (target < a[mid])
                return FindNearestLEQElementInTheArray(a, startIndex, mid - 1, target);
            else
                return FindNearestLEQElementInTheArray(a, mid, endIndex, target);
        }

        private static int FindNearestLEQElementInTheArray(int[] a, int target)
        {
            return FindNearestLEQElementInTheArray(a, 0, a.Length - 1, target);
        }

        private static int gcd(int a, int b)
        {
            int r = a % b;
            while (r != 0)
            {
                a = b;
                b = r;
                r = a % b;
            }
            return b;
        }

        //----------------------------------------------------------------------------

        static void Main(string[] args)
        {
            int r = 0, g = 0, b = 0;

            ReadInts(ref r, ref g, ref b);

            int a1 = r / 3 + g / 3 + b / 3;

            int a2 = 0;
            if (r>=1 && g>=1 && b>=1)
                a2 = 1 + (r - 1) / 3 + (g - 1) / 3 + (b - 1) / 3;

            int a3 = 0;
            if (r>=2 && g>=2 && b>=2)
                a3 = 2 + (r - 2) / 3 + (g - 2) / 3 + (b - 2) / 3;

            PrintLn(MyMax(a1,a2,a3));

        }

    }

}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;
			bool hasRest = false;

			if (red % 3 > 0)
			{
				hasRest = true;
				result += red / 3;
				red = red % 3;
			}

			if (green % 3 > 0)
			{
				hasRest = true;
				result += green / 3;
				green = green % 3;
			}

			if (blue % 3 > 0)
			{
				hasRest = true;
				result += blue / 3;
				blue = blue % 3;
			}

			if (hasRest)
			{
				var min = Math.Min(Math.Min(red, green), blue);
				Console.WriteLine(result + min);
				return;
			}

			Console.WriteLine(red / 3 + green / 3 + blue / 3);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			var mod = red % 3;
			if (mod == 0)
			{
				result += (red / 3) - 1;
				red = 3;
			}
			else
			{
				result += red / 3;
				red = red % 3;
			}

			mod = green % 3;
			if (mod == 0)
			{
				result += (green / 3) - 1;
				green = 3;
			}
			else
			{
				result += green / 3;
				green = green % 3;
			}

			mod = blue % 3;
			if (mod == 0)
			{
				result += (blue / 3) - 1;
				blue = 3;
			}
			else
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			if (min == 3)
			{
				result += 3;
			}
			else if (min == 2 || red + green + blue >= 7)
			{
				result += 2;
			}
			else if(min == 1 || (red == 3 || green == 3 || blue == 3))
			{
				result++;
			}
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			if (red % 3 > 0)
			{
				result += red / 3;
				red = red % 3;
			}

			if (green % 3 > 0)
			{
				result += green / 3;
				green = green % 3;
			}

			if (blue % 3 > 0)
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			Console.WriteLine(result + min);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			var mod = red % 3;
			if (mod == 0)
			{
				result += (red / 3) - 1;
				red = 3;
			}
			else
			{
				result += red / 3;
				red = red % 3;
			}

			mod = green % 3;
			if (mod == 0)
			{
				result += (green / 3) - 1;
				green = 3;
			}
			else
			{
				result += green / 3;
				green = green % 3;
			}

			mod = blue % 3;
			if (mod == 0)
			{
				result += (blue / 3) - 1;
				blue = 3;
			}
			else
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			Console.WriteLine(result + min);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			var mod = red % 3;
			if (mod == 0)
			{
				if (red > 0)
				{
					result += (red / 3) - 1;
					red = 3;
				}
			}
			else
			{
				result += red / 3;
				red = red % 3;
			}

			mod = green % 3;
			if (mod == 0)
			{
				if (green > 0)
				{
					result += (green / 3) - 1;
					green = 3;
				}
			}
			else
			{
				result += green / 3;
				green = green % 3;
			}

			mod = blue % 3;
			if (mod == 0)
			{
				if (blue > 0)
				{
					result += (blue / 3) - 1;
					blue = 3;
				}
			}
			else
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			if (min == 3)
			{
				result += 3;
			}
			else if (min == 2 || red + green + blue >= 6)
			{
				result += 2;
			}
			else if(min == 1 || (red == 3 || green == 3 || blue == 3))
			{
				result++;
			}
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			var min = Math.Min(Math.Min(red, green), blue);
			var result = min + (red - min) / 3 + (green - min) / 3 + (blue - min) / 3;
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			var mod = red % 3;
			if (mod == 0)
			{
				if (red > 0)
				{
					result += (red / 3) - 1;
					red = 3;
				}
			}
			else
			{
				result += red / 3;
				red = red % 3;
			}

			mod = green % 3;
			if (mod == 0)
			{
				if (green > 0)
				{
					result += (green / 3) - 1;
					green = 3;
				}
			}
			else
			{
				result += green / 3;
				green = green % 3;
			}

			mod = blue % 3;
			if (mod == 0)
			{
				if (blue > 0)
				{
					result += (blue / 3) - 1;
					blue = 3;
				}
			}
			else
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			if (min == 3)
			{
				result += 3;
			}
			else if (min == 2 || red + green + blue >= 7)
			{
				result += 2;
			}
			else if(min == 1 || (red == 3 || green == 3 || blue == 3))
			{
				result++;
			}
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			var mod = red % 3;
			if (mod == 0)
			{
				if (red > 0)
				{
					result += (red / 3) - 1;
					red = 3;
				}
			}
			else
			{
				result += red / 3;
				red = red % 3;
			}

			mod = green % 3;
			if (mod == 0)
			{
				if (green > 0)
				{
					result += (green / 3) - 1;
					green = 3;
				}
			}
			else
			{
				result += green / 3;
				green = green % 3;
			}

			mod = blue % 3;
			if (mod == 0)
			{
				if (blue > 0)
				{
					result += (blue / 3) - 1;
					blue = 3;
				}
			}
			else
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			if (min == 3)
			{
				result += 3;
			}
			else if (min == 2 || (min < 2 && red + green + blue >= 7))
			{
				result += 2;
			}
			else if(min == 1 || (red == 3 || green == 3 || blue == 3))
			{
				result++;
			}
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			var mod = red % 3;
			if (mod == 0)
			{
				result += (red / 3) - 1;
				red = 3;
			}
			else
			{
				result += red / 3;
				red = red % 3;
			}

			mod = green % 3;
			if (mod == 0)
			{
				result += (green / 3) - 1;
				green = 3;
			}
			else
			{
				result += green / 3;
				green = green % 3;
			}

			mod = blue % 3;
			if (mod == 0)
			{
				result += (blue / 3) - 1;
				blue = 3;
			}
			else
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			if (min == 3)
			{
				result += 3;
			}
			else if (min == 2 || red + green + blue >= 7)
			{
				result += 2;
			}
			else
			{
				result++;
			}
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();

			var red = inputs.ElementAt(0);
			var green = inputs.ElementAt(1);
			var blue = inputs.ElementAt(2);

			long result = 0;

			var mod = red % 3;
			if (red > 0 && mod == 0)
			{
				result += (red / 3) - 1;
				red = 3;
			}
			else
			{
				result += red / 3;
				red = red % 3;
			}

			mod = green % 3;
			if (green > 0 && mod == 0)
			{
				result += (green / 3) - 1;
				green = 3;
			}
			else
			{
				result += green / 3;
				green = green % 3;
			}

			mod = blue % 3;
			if (blue > 0 && mod == 0)
			{
				result += (blue / 3) - 1;
				blue = 3;
			}
			else
			{
				result += blue / 3;
				blue = blue % 3;
			}

			var min = Math.Min(Math.Min(red, green), blue);
			if (min == 3)
			{
				result += 3;
			}
			else if (min == 2 || red + green + blue >= 7)
			{
				result += 2;
			}
			else if(min == 1)
			{
				result++;
			}
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace olimp
{

    class Node
    {
        public List<Node> Roads;
        public List<Node> ClosedRoads;
        public int Id,Mark;
    }

    static class Program
    {
        private static void Main()
        {
            string[] s =  Console.ReadLine().Split(' ');
            Array.Sort(s);
            int r, g, b;
            r = int.Parse(s[0]);
            g = int.Parse(s[1]);
            b = int.Parse(s[2]);
            int ans = r + (g-r)/3 + (b-r)/3;

            Console.ReadLine();
        }

        static void ReadIntPair(out int a1, out int a2)
        {
            string[] s = Console.ReadLine().Split(' ');
            a1 = int.Parse(s[0]);
            a2 = int.Parse(s[1]);
        }

        static long ReadNextInt()
        {
            char c;
            StringBuilder builder = new StringBuilder(4);
            while (char.IsDigit(c = (char) Console.Read()) || c == '-'||c == '\r' || c == '\n')
            {
                if (c == '\r' || c == '\n')
                    continue;
                builder.Append(c);
            }
            return long.Parse(builder.ToString());
        }

        static int Sum1(int n)
        {
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += (int)(Math.Pow(-1, i)*Math.Pow(n - i, 2));
            }
            return sum;
        }

        static int Sum2(int n)
        {
            return (n*(n+1))/2;
        }

        static double Log10(double x)
        {
            int n = CalnN((int) x);
            double val = n;
            double last = x;
            for (int i = 1; i <= sizeof(double) * 8; i++)
            {
                last = last*last;
                if (last >= 10)
                {
                    val += 1/Math.Pow(2, i);
                    last /= 10;
                }
            }
            return val;
        }

        static int CalnN(int x)
        {
            int i = 0;
            for (; Math.Pow(x, i + 1) < x; i++)
            {
            }
            return i;
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace olimp
{

    class Node
    {
        public List<Node> Roads;
        public List<Node> ClosedRoads;
        public int Id,Mark;
    }

    static class Program
    {
        private static void Main()
        {
            string[] s =  Console.ReadLine().Split(' ');
            Array.Sort(s);
            int r, g, b;
            r = int.Parse(s[0]);
            g = int.Parse(s[1]);
            b = int.Parse(s[2]);
            int ans = r + (g-r)/3 + (b-r)/3;
            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static void ReadIntPair(out int a1, out int a2)
        {
            string[] s = Console.ReadLine().Split(' ');
            a1 = int.Parse(s[0]);
            a2 = int.Parse(s[1]);
        }

        static long ReadNextInt()
        {
            char c;
            StringBuilder builder = new StringBuilder(4);
            while (char.IsDigit(c = (char) Console.Read()) || c == '-'||c == '\r' || c == '\n')
            {
                if (c == '\r' || c == '\n')
                    continue;
                builder.Append(c);
            }
            return long.Parse(builder.ToString());
        }

        static int Sum1(int n)
        {
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += (int)(Math.Pow(-1, i)*Math.Pow(n - i, 2));
            }
            return sum;
        }

        static int Sum2(int n)
        {
            return (n*(n+1))/2;
        }

        static double Log10(double x)
        {
            int n = CalnN((int) x);
            double val = n;
            double last = x;
            for (int i = 1; i <= sizeof(double) * 8; i++)
            {
                last = last*last;
                if (last >= 10)
                {
                    val += 1/Math.Pow(2, i);
                    last /= 10;
                }
            }
            return val;
        }

        static int CalnN(int x)
        {
            int i = 0;
            for (; Math.Pow(x, i + 1) < x; i++)
            {
            }
            return i;
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace olimp
{

    class Node
    {
        public List<Node> Roads;
        public List<Node> ClosedRoads;
        public int Id,Mark;
    }

    static class Program
    {
        private static void Main()
        {
            string[] s =  Console.ReadLine().Split(' ');
            Array.Sort(s);
            int r, g, b;
            r = int.Parse(s[0]);
            g = int.Parse(s[1]);
            b = int.Parse(s[2]);
            int ans = r + (g-r)/3 + (b-r)/3;
            int ans2 = b / 3 + g / 3 + Math.Min(r, Math.Min(b % 3, g % 3)) + (r - Math.Min(r, Math.Min(b % 3, g % 3)))/3;
            ans = Math.Max(ans, ans2);
            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static void ReadIntPair(out int a1, out int a2)
        {
            string[] s = Console.ReadLine().Split(' ');
            a1 = int.Parse(s[0]);
            a2 = int.Parse(s[1]);
        }

        static long ReadNextInt()
        {
            char c;
            StringBuilder builder = new StringBuilder(4);
            while (char.IsDigit(c = (char) Console.Read()) || c == '-'||c == '\r' || c == '\n')
            {
                if (c == '\r' || c == '\n')
                    continue;
                builder.Append(c);
            }
            return long.Parse(builder.ToString());
        }

        static int Sum1(int n)
        {
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += (int)(Math.Pow(-1, i)*Math.Pow(n - i, 2));
            }
            return sum;
        }

        static int Sum2(int n)
        {
            return (n*(n+1))/2;
        }

        static double Log10(double x)
        {
            int n = CalnN((int) x);
            double val = n;
            double last = x;
            for (int i = 1; i <= sizeof(double) * 8; i++)
            {
                last = last*last;
                if (last >= 10)
                {
                    val += 1/Math.Pow(2, i);
                    last /= 10;
                }
            }
            return val;
        }

        static int CalnN(int x)
        {
            int i = 0;
            for (; Math.Pow(x, i + 1) < x; i++)
            {
            }
            return i;
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace olimp
{

    class Node
    {
        public List<Node> Roads;
        public List<Node> ClosedRoads;
        public int Id,Mark;
    }

    static class Program
    {
        private static void Main()
        {
            string[] s =  Console.ReadLine().Split(' ');
            Array.Sort(s);
            int r, g, b;
            r = int.Parse(s[0]);
            g = int.Parse(s[1]);
            b = int.Parse(s[2]);
            int ans = r + (g-r)/3 + (b-r)/3;
            int ans2 = b / 3 + g / 3 + Math.Max(r, Math.Max(b % 3, g % 3)) + (r - Math.Max(r, Math.Max(b % 3, g % 3)))/3;
            ans = Math.Max(ans, ans2);
            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static void ReadIntPair(out int a1, out int a2)
        {
            string[] s = Console.ReadLine().Split(' ');
            a1 = int.Parse(s[0]);
            a2 = int.Parse(s[1]);
        }

        static long ReadNextInt()
        {
            char c;
            StringBuilder builder = new StringBuilder(4);
            while (char.IsDigit(c = (char) Console.Read()) || c == '-'||c == '\r' || c == '\n')
            {
                if (c == '\r' || c == '\n')
                    continue;
                builder.Append(c);
            }
            return long.Parse(builder.ToString());
        }

        static int Sum1(int n)
        {
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += (int)(Math.Pow(-1, i)*Math.Pow(n - i, 2));
            }
            return sum;
        }

        static int Sum2(int n)
        {
            return (n*(n+1))/2;
        }

        static double Log10(double x)
        {
            int n = CalnN((int) x);
            double val = n;
            double last = x;
            for (int i = 1; i <= sizeof(double) * 8; i++)
            {
                last = last*last;
                if (last >= 10)
                {
                    val += 1/Math.Pow(2, i);
                    last /= 10;
                }
            }
            return val;
        }

        static int CalnN(int x)
        {
            int i = 0;
            for (; Math.Pow(x, i + 1) < x; i++)
            {
            }
            return i;
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace olimp
{

    class Node
    {
        public List<Node> Roads;
        public List<Node> ClosedRoads;
        public int Id,Mark;
    }

    static class Program
    {
        private static void Main()
        {
            string[] s =  Console.ReadLine().Split(' ');
            Array.Sort(s);
            int r, g, b;
            r = int.Parse(s[0]);
            g = int.Parse(s[1]);
            b = int.Parse(s[2]);
            int ans = r + (g-r)/3 + (b-r)/3;
            int ans2 = b / 3 + g / 3 + Math.Min(r, Math.Max(b % 3, g % 3)) + (r - Math.Min(r, Math.Max(b % 3, g % 3)))/3;
            ans = Math.Max(ans, ans2);
            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static void ReadIntPair(out int a1, out int a2)
        {
            string[] s = Console.ReadLine().Split(' ');
            a1 = int.Parse(s[0]);
            a2 = int.Parse(s[1]);
        }

        static long ReadNextInt()
        {
            char c;
            StringBuilder builder = new StringBuilder(4);
            while (char.IsDigit(c = (char) Console.Read()) || c == '-'||c == '\r' || c == '\n')
            {
                if (c == '\r' || c == '\n')
                    continue;
                builder.Append(c);
            }
            return long.Parse(builder.ToString());
        }

        static int Sum1(int n)
        {
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += (int)(Math.Pow(-1, i)*Math.Pow(n - i, 2));
            }
            return sum;
        }

        static int Sum2(int n)
        {
            return (n*(n+1))/2;
        }

        static double Log10(double x)
        {
            int n = CalnN((int) x);
            double val = n;
            double last = x;
            for (int i = 1; i <= sizeof(double) * 8; i++)
            {
                last = last*last;
                if (last >= 10)
                {
                    val += 1/Math.Pow(2, i);
                    last /= 10;
                }
            }
            return val;
        }

        static int CalnN(int x)
        {
            int i = 0;
            for (; Math.Pow(x, i + 1) < x; i++)
            {
            }
            return i;
        }
    }
}

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

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            Console.SetIn(new System.IO.StreamReader(@"..\..\..\in"));
            Console.SetOut(new System.IO.StreamWriter(@"..\..\..\out"));
            for (int testN = 0; testN < 4; testN++)
            {
#endif
                //SetCulture();
                var r = NextInt();
                var g = NextInt();
                var b = NextInt();
                int m = Math.Min(r, Math.Min(g, b));

                int res = m;
                r -= m;
                g -= m;
                b -= m;
                res += r / 3;
                res += g / 3;
                res += b / 3;
                Console.WriteLine(res);
                //Console.WriteLine(string.Format(NumberFormatInfo.InvariantInfo, "{0:F4}", res));
#if !ONLINE_JUDGE
                Console.ReadLine();
            }
            Console.In.Close();
            Console.Out.Close();
#endif
        }

        private static char[] _defaultSplitter = new char[] { ' ', '\t' };

        private static void SetCulture()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        }

        private static char[] ReadChars(int n)
        {
            char[] buffer = new char[n];
            Console.In.ReadBlock(buffer, 0, n);
            return buffer;
        }

        private static string[] ReadAll()
        {
            return Console.In.ReadToEnd().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords()
        {
            return ReadWords(_defaultSplitter);
        }

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

        private static int[] ReadInts(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        private static int[] ReadInts()
        {
            return ReadInts(_defaultSplitter);
        }

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

        private static double ReadDouble()
        {
            return double.Parse(Console.ReadLine(), NumberFormatInfo.InvariantInfo);
        }

        private static int _pos = 0;
        private static string[] _inputLine = new string[0];

        private static void CheckInputLine()
        {
            if (_pos >= _inputLine.Length)
            {
                _inputLine = ReadWords();
                _pos = 0;
            }
        }

        private static string NextWord()
        {
            CheckInputLine();
            return _inputLine[_pos++];
        }

        private static int NextInt()
        {
            CheckInputLine();
            return int.Parse(_inputLine[_pos++]);
        }

        private static long NextLong()
        {
            CheckInputLine();
            return long.Parse(_inputLine[_pos++]);
        }
    }
}

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

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            Console.SetIn(new System.IO.StreamReader(@"..\..\..\in"));
            Console.SetOut(new System.IO.StreamWriter(@"..\..\..\out"));
            for (int testN = 0; testN < 4; testN++)
            {
#endif
                //SetCulture();
                var r = NextInt();
                var g = NextInt();
                var b = NextInt();
                int m = Math.Min(r, Math.Min(g, b));

                long res = m;
                r -= m;
                g -= m;
                b -= m;
                res += r / 3;
                res += g / 3;
                res += b / 3;
                Console.WriteLine(res);
                //Console.WriteLine(string.Format(NumberFormatInfo.InvariantInfo, "{0:F4}", res));
#if !ONLINE_JUDGE
                Console.ReadLine();
            }
            Console.In.Close();
            Console.Out.Close();
#endif
        }

        private static char[] _defaultSplitter = new char[] { ' ', '\t' };

        private static void SetCulture()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        }

        private static char[] ReadChars(int n)
        {
            char[] buffer = new char[n];
            Console.In.ReadBlock(buffer, 0, n);
            return buffer;
        }

        private static string[] ReadAll()
        {
            return Console.In.ReadToEnd().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords()
        {
            return ReadWords(_defaultSplitter);
        }

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

        private static int[] ReadInts(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        private static int[] ReadInts()
        {
            return ReadInts(_defaultSplitter);
        }

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

        private static double ReadDouble()
        {
            return double.Parse(Console.ReadLine(), NumberFormatInfo.InvariantInfo);
        }

        private static int _pos = 0;
        private static string[] _inputLine = new string[0];

        private static void CheckInputLine()
        {
            if (_pos >= _inputLine.Length)
            {
                _inputLine = ReadWords();
                _pos = 0;
            }
        }

        private static string NextWord()
        {
            CheckInputLine();
            return _inputLine[_pos++];
        }

        private static int NextInt()
        {
            CheckInputLine();
            return int.Parse(_inputLine[_pos++]);
        }

        private static long NextLong()
        {
            CheckInputLine();
            return long.Parse(_inputLine[_pos++]);
        }
    }
}

using System;
using System.Linq;

namespace CielAndFlowers
{
    class CielAndFlowers
    {
        static void Main(string[] args)
        {
            int[] values = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int countIndividual = 0, countMix = 0;
            int[] tempValues = new int[3];

            Array.Sort(values);

            // Count Individual bouquets + remainder
            for (int i = 0; i < 3; i++)
            {
                tempValues[i] = values[i] % 3;
                countIndividual += values[i] / 3;
            }

            Array.Sort(tempValues);

            countIndividual += tempValues[0];

            // Count Mixing bouquets + remainder
            countMix += values[0];

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

            for (int i = 0; i < 3; i++)
                countMix += values[i] / 3;

            Console.WriteLine(Math.Max(countIndividual, countMix));
        }
    }
}

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

class ProblemB
{
    static void Main()
    {
        var s = Console.ReadLine().Split(' ');
        var r = int.Parse(s[0]);
        var g = int.Parse(s[1]);
        var b = int.Parse(s[2]);

        var l = r/3;
        var m = g/3;
        var n = b/3;

        var x = r % 3;
        var y = g % 3;
        var z = b % 3;
        int[] array = { x, y, z };
        var min = array.Min();

        var num = l + m + n + min;
        Console.WriteLine(num.ToString());
    }
}

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

class ProblemB
{
    static void Main()
    {
        var s = Console.ReadLine().Split(' ');
        var r = int.Parse(s[0]);
        var g = int.Parse(s[1]);
        var b = int.Parse(s[2]);

        var l = r/3;
        var m = g/3;
        var n = b/3;

        var x = r % 3;
        var y = g % 3;
        var z = b % 3;
        int[] array = { x, y, z };
        var min = 0;
        if (x == 2 && y == 2 && n > 0)
        {
            min += 2;
            n--;
        }
        else if (x == 2 && z == 2 && m > 0)
        {
            min += 2;
            m--;
        }
        else if (y == 2 && z == 2 && l > 0)
        {
            min += 2;
            l--;
        }
        else min += array.Min();
        var num = l + m + n + min;
        Console.WriteLine(num.ToString());
    }
}

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

namespace ConsoleApplication27
{
    class Program
    {
        static void Main0(string[] args)
        {
            string[] line = Console.ReadLine().Split();
            int n = int.Parse(line[0]);
            int m = int.Parse(line[1]);

            Console.WriteLine(n + m - 1);
            Console.WriteLine("1 1");
            for (int i = 1; i < n; i++)
                Console.WriteLine("{0} 1", i + 1);
            for (int i = 1; i < m; i++)
                Console.WriteLine("1 {0}", i + 1);
        }

        static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split();
            int r = int.Parse(line[0]);
            int g = int.Parse(line[1]);
            int b = int.Parse(line[2]);

            int mixed = Math.Min(r, Math.Min(g, b));
            Console.WriteLine(mixed + (r - mixed) / 3 + (g - mixed) / 3 + (b - mixed) / 3);
        }
    }
}

using System;
using System.Linq;
class Demo
{
    static void Main()
    {
        long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long r = a[0], ans=0;
        long g = a[1];
        long b = a[2];
        if (a.Count(x => x % 3 == 0) > 1)
            ans = r / 3 + g / 3 + b / 3;
        else
            ans = a.Min() + (r - a.Min()) / 3 + (g - a.Min()) / 3 + (b - a.Min()) / 3;
        Console.WriteLine(ans);
    }
}

using System;
using System.Linq;
class Demo
{
    static void Main()
    {
        long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long r = a[0], ans = 0;
        long g = a[1];
        long b = a[2];
        a[0] = r % 3; a[1] = g % 3; a[2] = b % 3;
        bool flag = a.Count(x => x > 1) == 3;
        if (flag)
        {
            ans = a.Min();
            r -= a.Min();
            g -= a.Min();
            b -= a.Min();
        }
        ans += r / 3 + g / 3 + b / 3;
        if (!flag) ans += a.Min();
        Console.WriteLine(ans);
    }
}

using System;
using System.Linq;
class Demo
{
    static void Main()
    {
        long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long r = a[0];
        long g = a[1];
        long b = a[2];
        long ans = a.Min() + (r - a.Min()) / 3 + (g - a.Min()) / 3 + (b - a.Min()) / 3;
        Console.WriteLine(ans);
    }
}

using System;
using System.Linq;
class Demo
{
    static void Main()
    {
        long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long r = a[0], ans = 0;
        long g = a[1];
        long b = a[2];
        a[0] = r % 3; a[1] = g % 3; a[2] = b % 3;
        bool flag = a.Count(x => x > 1) > 1;
        if (flag)
        {
            ans = 2;
            r -= 2;
            g -= 2;
            b -= 2;
        }
        ans += r / 3 + g / 3 + b / 3;
        if (!flag) ans += a.Min();
        Console.WriteLine(ans);
    }
}

using System;

namespace Flowers
{
    class Flowers
    {
        static void Main(string[] args)
        {
            string[] rgb = Console.ReadLine().Split(' ');
            int r = int.Parse(rgb[0]);
            int g = int.Parse(rgb[1]);
            int b = int.Parse(rgb[2]);

            int f = Math.Min(r, Math.Min(g, b));
            r -= f;
            g -= f;
            b -= f;

            f += r / 3;
            f += g / 3;
            f += b / 3;

            Console.WriteLine(f);
        }
    }
}

using System;

namespace Flowers
{
    class Flowers
    {
        static void Main(string[] args)
        {
            string[] rgb = Console.ReadLine().Split(' ');
            long r = long.Parse(rgb[0]);
            long g = long.Parse(rgb[1]);
            long b = long.Parse(rgb[2]);

            long f = Math.Min(r, Math.Min(g, b));
            r -= f;
            g -= f;
            b -= f;

            f += r / 3;
            f += g / 3;
            f += b / 3;

            Console.WriteLine(f);
        }
    }
}

using System;

namespace Flowers
{
    class Flowers
    {
        static void Main(string[] args)
        {
            string[] rgb = Console.ReadLine().Split(' ');
            long r = long.Parse(rgb[0]);
            long g = long.Parse(rgb[1]);
            long b = long.Parse(rgb[2]);

            long f = Math.Min(r, Math.Min(g, b));
            f -= f % 3;
            r -= f;
            g -= f;
            b -= f;

            f += r / 3;
            r %= 3;

            f += g / 3;
            g %= 3;

            f += b / 3;
            b %= 3;

            f += Math.Min(r, Math.Min(g, b));

            Console.WriteLine(f);
        }
    }
}

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var j = Console.ReadLine().Split(' ').Select(int.Parse);
            int a = j.ElementAt(0);
            int b = j.ElementAt(1);
            int c = j.ElementAt(2);
            int x = j.Min();
            a -= x; b -= x; c -= x;
            Console.WriteLine(a / 3 + b / 3 + c / 3 + x);

        }
    }
}

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var j = Console.ReadLine().Split(' ').Select(int.Parse);
            int a = j.ElementAt(0);
            int b = j.ElementAt(1);
            int c = j.ElementAt(2);
            int x = j.Min();
            int tres1 = (a-x) / 3 + (b-x) / 3 + (c-x) / 3 + x;
            int tres2 = a / 3 + b / 3 + c / 3 + (new int[] { a % 3, b % 3, c % 3 }).Min();
            Console.WriteLine(Math.Max(tres1,tres2));

        }
    }
}

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

namespace CodeForces
{
    class R190_Div2_B
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int rr = int.Parse(s[0]);
            int gg = int.Parse(s[1]);
            int bb = int.Parse(s[2]);

            int r = rr, g = gg, b = bb;
            int cnt = Math.Min(r, Math.Min(g, b));
            r -= cnt; g -= cnt; b -= cnt;
            cnt += r / 3 + g / 3 + b / 3;

            r = rr; g = gg; b = bb;
            int cnt2 = r / 3; r = r % 3;
            cnt2 += g / 3; g = g % 3;
            cnt2 += b / 3; b = b % 3;

            cnt2 += Math.Min(r, Math.Min(g, b));

            Console.WriteLine(Math.Max(cnt,cnt2));
        }
    }
}

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

public class taskB
{
    public class MyReader
    {
        private TextReader instream;

        public int[] ReadIntArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            int[] a = new int[spl.Length];
            for (int i = 0; i < a.Length; i++)
                a[i] = int.Parse(spl[i]);
            return a;
        }

        public long[] ReadLongArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            long[] a = new long[spl.Length];
            for (int i = 0; i < a.Length; i++)
                a[i] = long.Parse(spl[i]);
            return a;
        }

        public double[] ReadDoubleArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            double[] a = new double[spl.Length];

            System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
            nfi.NumberDecimalSeparator = ".";
            for (int i = 0; i < a.Length; i++)
                a[i] = double.Parse(spl[i], nfi);
            return a;
        }

        public int ReadInt()
        {
            return int.Parse(instream.ReadLine());
        }

        public long ReadLong()
        {
            return long.Parse(instream.ReadLine());
        }

        public void SetInStream(TextReader textReader)
        {
            this.instream = textReader;
        }

        internal string ReadLine()
        {
            return instream.ReadLine();
        }
    }

    static void Main(string[] args)
    {
        MyReader instream = new MyReader();
        instream.SetInStream(Console.In);

        TextWriter outstream = Console.Out;

        solve(instream, outstream);

    }

    private static void solve(MyReader instream, TextWriter outstream)
    {
        int[] rgb = instream.ReadIntArray();

        int min = Math.Min(Math.Min(rgb[0], rgb[1]), rgb[2]);

        for (int i = 0; i < 3; i++)
            rgb[i] -= min;
        int res = min;

        for (int i = 0; i < 3; i++)
        {
            res += (rgb[i] / 3);
        }

        outstream.WriteLine(res);
    }

}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string in_s = Console.ReadLine();
            string[] pra = in_s.Split(' ');
            int redNum = Convert.ToInt32(pra[0]);
            int greenNum = Convert.ToInt32(pra[1]);
            int yellowNum = Convert.ToInt32(pra[2]);
            int ans = 0;
            for (int i = 0; i <= 2; i++)
            {
                int slo = i;
                slo += (redNum - i) / 3;
                slo += (greenNum - i) / 3;
                slo += (yellowNum - i) / 3;
                if (slo > ans) ans = slo;
            }
            Console.WriteLine(ans);

        }
    }
}

using System;
using System.Linq;

class Program
{
    static double distance(int x1, int y1, int x2, int y2)
    {
        return 0.0;
    }

    static void Main()
    {
        string str = Console.ReadLine();
        var data = str.Split(new char[] { ' ' });

        int[] rgb = new int[3];

        rgb[0] = int.Parse(data[0]);
        rgb[1] = int.Parse(data[1]);
        rgb[2] = int.Parse(data[2]);

        int min = rgb.Min();
        int result = 0;

        for (int i = min; i > min - 3; i--)
        {
            int buckets = i + (rgb[0] - i) / 3 + (rgb[1] - i) / 3 + (rgb[2] - i) / 3;

            if (result < buckets) result = buckets;
        }

        Console.WriteLine("{0}", result);
    }
}

using System;
using System.Linq;

class Program
{
    static double distance(int x1, int y1, int x2, int y2)
    {
        return 0.0;
    }

    static void Main()
    {
        string str = Console.ReadLine();
        var data = str.Split(new char[] { ' ' });

        int[] rgb = new int[3];

        rgb[0] = int.Parse(data[0]);
        rgb[1] = int.Parse(data[1]);
        rgb[2] = int.Parse(data[2]);

        int count = 0;

        int min = rgb.Min();
        count = min;

        rgb[0] -= min;
        rgb[1] -= min;
        rgb[2] -= min;

        count += rgb[0] / 3;
        count += rgb[1] / 3;
        count += rgb[2] / 3;

        Console.WriteLine("{0}", count);
    }
}

using System;
using System.Linq;

class Program
{
    static double distance(int x1, int y1, int x2, int y2)
    {
        return 0.0;
    }

    static void Main()
    {
        string str = Console.ReadLine();
        var data = str.Split(new char[] { ' ' });

        int[] rgb = new int[3];

        rgb[0] = int.Parse(data[0]);
        rgb[1] = int.Parse(data[1]);
        rgb[2] = int.Parse(data[2]);

        int count1 = 0;
        int[] rgb1 = (int[]) rgb.Clone();

        int min = rgb1.Min();
        count1 = min;

        rgb1[0] -= min;
        rgb1[1] -= min;
        rgb1[2] -= min;

        count1 += rgb1[0] / 3;
        count1 += rgb1[1] / 3;
        count1 += rgb1[2] / 3;

        int count2 = 0;
        int[] rgb2 = (int[])rgb.Clone();

        count2 += rgb2[0] / 3; rgb2[0] = rgb2[0] % 3;
        count2 += rgb2[1] / 3; rgb2[1] = rgb2[1] % 3;
        count2 += rgb2[2] / 3; rgb2[2] = rgb2[2] % 3;

        count2 = rgb2.Min();

        Console.WriteLine("{0}", Math.Max(count1, count2));
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long t = a.Sum();
        t /= 3;
        if (a.Any(d => d % 3 == 0)) t--;
        Console.WriteLine(t);
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long t = a.Sum();
        if (a.Any(d => d % 3 == 0)) t--;
        Console.WriteLine(t);
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long t = a.Sum();
        t /= 3;
        if (a.Any(d => d % 3 == 0) && !a.All(d => d % 3 == 0)) t--;
        Console.WriteLine(t);
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var _ = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var r = _[0]; var g = _[1]; var b = _[2];
        var a = r / 3 + g / 3 + b / 3 + r % 3 != 0 && g % 3 != 0 && b % 3 != 0 ? (r % 3 + g % 3 + b % 3) / 3 : 0;
        Console.WriteLine(a);
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var _ = Console.ReadLine().Split().Select(int.Parse).ToArray();
        if (_.All(d => d % 3 == 0))
        {
            Console.WriteLine(_.Sum() / 3);
        }
        else
        {
            Console.WriteLine(_.Sum() / 3 - (_.Count(d => d == 0) == 1 ? 1 : 0));
        }
    }
}

using System;
using System.Linq;
using System.IO;
class Program
{
    static TextReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
    static TextWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
    static void Main()
    {
        var _ = reader.ReadLine().Split().Select(int.Parse).ToArray();
        var r = _[0];
        var g = _[1];
        var b = _[2];
        var a = r / 3 + g / 3 + b / 3 + (r % 3 + g % 3 + b % 3) / 3;
        writer.WriteLine(a);
        reader.Close();
        writer.Close();
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        long t = a.Sum();
        t /= 3;
        if (a.Any(d => d % 3 == 0) && !a.All(d => d % 3 == 0)
            && a[0] != a[1] && a[1] != a[2]) t--;
        Console.WriteLine(t);
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var _ = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Console.WriteLine(_.Sum() / 3 - (_.Count(d => d == 0) == 1 ? 1 : 0));
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        var b = 0;
        if (!(a[0] > 0 && a[1] > 0 && a[2] > 0))
        {
            Console.WriteLine(a[0] / 3 + a[1] / 3 + a[2] / 3);
        }
        else
        {
            if (a[0] % 3 != 0 && a[1] % 3 != 0 && a[2] % 3 != 0)
            {
                b = 1;
            }
            Console.WriteLine(a.Sum() / 3 - b);
        }
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var _ = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var r = _[0]; var g = _[1]; var b = _[2];
        var a = r / 3 + g / 3 + b / 3 + (r % 3 != 0 && g % 3 != 0 && b % 3 != 0 ? (r % 3 + g % 3 + b % 3) / 3 : 0);
        Console.WriteLine(a);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;

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

		public class Pair
		{
			public long First;

			public long 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<int> Edges;
		}

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

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		public static Dictionary<long, long> mp = new Dictionary<long, long>();
		public static long Go(long u, long v, long w)
		{
			long ans = 0;
			while (u != v)
				if (u > v)
				{
					if (!mp.ContainsKey(u))
						mp.Add(u, 0);
					ans += mp[u];
					mp[u] += w;
					u /= 2;
				}
				else
				{
					if (!mp.ContainsKey(v))
						mp.Add(v, 0);
					ans += mp[v];
					mp[v] += w;
					v /= 2;
				}
			return ans;
		}

		private static void Main()
		{
			var l = ReadListOfLongs();
			var r = l[0];
			var g = l[1];
			var b = l[2];
			long ans = 0;
			for (var i = 0; i < 3; ++i)
			{
				if (i >= Math.Min(r, Math.Min(g, b)))
				{
					var cur = i + (r - i) / 3 + (b - i) / 3 + (g - i) / 3;
					ans = Math.Max(cur, ans);
				}
			}
			Console.WriteLine(ans);
			Console.ReadLine();
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;

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

		public class Pair
		{
			public long First;

			public long 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<int> Edges;
		}

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

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		public static Dictionary<long, long> mp = new Dictionary<long, long>();
		public static long Go(long u, long v, long w)
		{
			long ans = 0;
			while (u != v)
				if (u > v)
				{
					if (!mp.ContainsKey(u))
						mp.Add(u, 0);
					ans += mp[u];
					mp[u] += w;
					u /= 2;
				}
				else
				{
					if (!mp.ContainsKey(v))
						mp.Add(v, 0);
					ans += mp[v];
					mp[v] += w;
					v /= 2;
				}
			return ans;
		}

		private static void Main()
		{
			var l = ReadListOfLongs();
			var r = l[0];
			var g = l[1];
			var b = l[2];
			var ans1 = Math.Min(r, Math.Min(g, b));
			ans1 = ans1 + (r - ans1) / 3 + (b - ans1) / 3 + (g - ans1) / 3;
			var ans = r / 3 + b / 3 + g / 3;
			ans = ans + Math.Min(r % 3, Math.Min(b % 3, g % 3));
			Console.WriteLine(Math.Max(ans, ans1));
			Console.ReadLine();
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;

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

		public class Pair
		{
			public long First;

			public long 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<int> Edges;
		}

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

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		public static Dictionary<long, long> mp = new Dictionary<long, long>();
		public static long Go(long u, long v, long w)
		{
			long ans = 0;
			while (u != v)
				if (u > v)
				{
					if (!mp.ContainsKey(u))
						mp.Add(u, 0);
					ans += mp[u];
					mp[u] += w;
					u /= 2;
				}
				else
				{
					if (!mp.ContainsKey(v))
						mp.Add(v, 0);
					ans += mp[v];
					mp[v] += w;
					v /= 2;
				}
			return ans;
		}

		private static void Main()
		{
			var l = ReadListOfLongs();
			var r = l[0];
			var g = l[1];
			var b = l[2];
			var ans = r / 3 + b / 3 + g / 3;
			ans = ans + Math.Min(r % 3, Math.Min(b % 3, g % 3));
			Console.WriteLine(ans);
			Console.ReadLine();
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;

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

		public class Pair
		{
			public long First;

			public long 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<int> Edges;
		}

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

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		public static Dictionary<long, long> mp = new Dictionary<long, long>();
		public static long Go(long u, long v, long w)
		{
			long ans = 0;
			while (u != v)
				if (u > v)
				{
					if (!mp.ContainsKey(u))
						mp.Add(u, 0);
					ans += mp[u];
					mp[u] += w;
					u /= 2;
				}
				else
				{
					if (!mp.ContainsKey(v))
						mp.Add(v, 0);
					ans += mp[v];
					mp[v] += w;
					v /= 2;
				}
			return ans;
		}

		private static void Main()
		{
			var l = ReadListOfLongs();
			var r = l[0];
			var g = l[1];
			var b = l[2];
			var ans = Math.Min(r, Math.Min(g, b));
			ans = ans + (r - ans) / 3 + (b - ans) / 3 + (g - ans) / 3;
			Console.WriteLine(ans);
			Console.ReadLine();
		}
	}
}

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

namespace MakeCalendar
{
    public static class MainClass
    {

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

        static void ReadInt(ref int a)
        {
            a = ReadIntArrayLine()[0];
        }

        static void ReadInts(ref int a, ref int b)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1];
        }

        static void ReadInts(ref int a, ref int b, ref int c)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3]; e = x[4];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d, ref int e, ref int f)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3]; e = x[4]; f = x[5];
        }

        static int[] ReadIntArrayLine()
        {
            char[] sep = { ' ' };
            return Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        static void PrintLn(object obj)
        {
            Console.WriteLine(obj.ToString());
        }

        public static string Reverse(string s)
        {
            char[] charArray = s.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }

        public static void PrintLnCollection<T>(IEnumerable<T> col)
        {
            PrintLn(string.Join(" ", col));
        }

        public static void PrintLn(params object[] v)
        {
            PrintLnCollection(v);
        }

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

        public static string MySubstring(this string str, int start, int finish)
        {
            if (start > finish) return "";
            return str.Substring(start, finish - start + 1);
        }

        public static bool IsInRange(this int a, int lb, int ub)
        {
            return (a >= lb) && (a <= ub);
        }

        private static void mergeDS(int i, int j, int[] a)
        {
            int t = a[j];
            for (int ii = 0; ii < a.Length; ii++)
            {
                if (a[ii] == t)
                    a[ii] = a[i];
            }
        }

        private static T MyMax<T>(params T[] a)
        {
            return a.Max();
        }

        private static T MyMin<T>(params T[] a)
        {
            return a.Min();
        }

        private static int[] GetPrimesLessThan(int x)
        {
            if (x < 2)
                return new int[0];

            int[] a = new int[x];

            a[0] = 1; a[1] = 1;

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == 0)
                    for (int j = 2 * i; j < a.Length; j += i)
                    {
                        a[j] = 1;
                    }
            }

            var abc = new List<int>(x);

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] == 0)
                    abc.Add(i);
            }

            return abc.ToArray();
        }

        private static int FindNearestLEQElementInTheArray(int[] a, int startIndex, int endIndex, int target)
        {
            if (startIndex == endIndex)
            {
                if (a[startIndex] <= target)
                    return startIndex;
                else
                    return -1;
            }

            if (startIndex + 1 == endIndex)
            {
                if (a[endIndex] <= target)
                    return endIndex;
                else if (a[startIndex] <= target)
                    return startIndex;
                else
                    return -1;
            }

            int mid = (startIndex + endIndex) / 2;
            if (target == a[mid])
                return mid;
            else if (target < a[mid])
                return FindNearestLEQElementInTheArray(a, startIndex, mid - 1, target);
            else
                return FindNearestLEQElementInTheArray(a, mid, endIndex, target);
        }

        private static int FindNearestLEQElementInTheArray(int[] a, int target)
        {
            return FindNearestLEQElementInTheArray(a, 0, a.Length - 1, target);
        }

        private static int gcd(int a, int b)
        {
            int r = a % b;
            while (r != 0)
            {
                a = b;
                b = r;
                r = a % b;
            }
            return b;
        }

        //----------------------------------------------------------------------------

        static Dictionary<string, int> mem = new Dictionary<string, int>();

        static int solve(int r, int g, int b)
        {
            if (r<0 || g<0 || b<0)
                return 0;

            if (r + g + b < 3)
                return 0;

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

            string str = r + "," + g + "," + b;

            if (mem.ContainsKey(r + "," + g + "," + b))
                return mem[r + "," + g + "," + b];

            mem[str] = 1 + MyMax(solve(r - 3, g, b), solve(r, g-3, b), solve(r, g, b-3), solve(r - 1, g-1, b-1));

            return mem[str];
        }

        static void Main(string[] args)
        {
            int r=0, g=0, b=0 ;

            ReadInts(ref r, ref g, ref b);

            int[] a = new int[3];

            a[0] = r % 3;
            a[1] = g % 3;
            a[2] = b % 3;

            Array.Sort(a);

            int d = 0;
            if (a[0] == 0 && a[1] == 1 && a[2] == 2)
                d = 1;

            PrintLn(((long)r + (long)g + (long)b) / 3 - d);

        }

    }

}