using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;
using static System.Math;
using System.Linq;
using static System.Array;
using System.Collections;

namespace DivideChocolate
{
    class Program
    {
        static long H;
        static long W;
        static long K;
        static string[] S;
        static void Main(string[] args)
        {
            var ABC = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            var A = ABC[0];
            var B = ABC[1];
            var C = ABC[2];

            if(A < B)
            {
                Swap(ref A, ref B);
            }
            if(B < C)
            {
                Swap(ref B, ref C);
            }
            if (A < B)
            {
                Swap(ref A, ref B);
            }

            var ans = A - B;
            C += (A - B);

            if ((A-C)%2 == 0)
            {
                ans += (A - C) / 2;
            }
            else
            {
                ans += ((A - C) / 2) + 2;
            }
            Console.WriteLine(ans);
        }
        static void Swap<T>(ref T a, ref T b)
        {
            var tmp = a;
            a = b;
            b = tmp;
        }

        static long Culculate(int i)
        {
            long ans = 0;
            var sum = new long[H];

            for (int j = 0; j < W; j++)
            {
                var tmp = new long[H];

                for (int k = 0; k < H;)
                {
                    long white = 0;
                    var st = k;
                    while (k < H)
                    {
                        if (S[k][j] == '1')
                        {
                            white++;
                            if(white > K)
                            {
                                return long.MaxValue;
                            }
                        }

                        if ((i & (int)Pow(2, k)) == 1)
                        {
                            for (int w = st; w <= k; w++)
                            {
                                tmp[w] = white;
                            }
                            white = 0;
                            k++;
                            break;
                        }
                        else
                        {
                            k++;
                        }
                    }


                    for (int w = st; w < H; w++)
                    {
                        tmp[w] = white;
                    }
                }

                for (int k = 0; k < H; k++)
                {
                    if(sum[k]+tmp[k] <= K)
                    {
                        sum[k] += tmp[k];
                    }
                    else
                    {
                        Array.Copy(tmp, sum,sum.Length);
                        ans++;
                        break;
                    }
                }
            }
            return ans;
        }
    }


    public class PriorityQueue<T> : IEnumerable<T>
    {
        private readonly List<T> _data = new List<T>();
        private readonly IComparer<T> _comparer;
        private readonly bool _isDescending;

        public PriorityQueue(IComparer<T> comparer, bool isDescending = true)
        {
            _comparer = comparer;
            _isDescending = isDescending;
        }

        public PriorityQueue(Comparison<T> comparison, bool isDescending = true)
            : this(Comparer<T>.Create(comparison), isDescending)
        {
        }

        public PriorityQueue(bool isDescending = true)
            : this(Comparer<T>.Default, isDescending)
        {
        }

        public void Enqueue(T item)
        {
            _data.Add(item);
            var childIndex = _data.Count - 1;
            while (childIndex > 0)
            {
                var parentIndex = (childIndex - 1) / 2;
                if (Compare(_data[childIndex], _data[parentIndex]) >= 0)
                    break;
                Swap(childIndex, parentIndex);
                childIndex = parentIndex;
            }
        }

        public T Dequeue()
        {
            var lastIndex = _data.Count - 1;
            var firstItem = _data[0];
            _data[0] = _data[lastIndex];
            _data.RemoveAt(lastIndex--);
            var parentIndex = 0;
            while (true)
            {
                var childIndex = parentIndex * 2 + 1;
                if (childIndex > lastIndex)
                    break;
                var rightChild = childIndex + 1;
                if (rightChild <= lastIndex && Compare(_data[rightChild], _data[childIndex]) < 0)
                    childIndex = rightChild;
                if (Compare(_data[parentIndex], _data[childIndex]) <= 0)
                    break;
                Swap(parentIndex, childIndex);
                parentIndex = childIndex;
            }
            return firstItem;
        }

        public T Peek()
        {
            return _data[0];
        }

        private void Swap(int a, int b)
        {
            var tmp = _data[a];
            _data[a] = _data[b];
            _data[b] = tmp;
        }

        private int Compare(T a, T b)
        {
            return _isDescending ? _comparer.Compare(b, a) : _comparer.Compare(a, b);
        }

        public int Count => _data.Count;

        public IEnumerator<T> GetEnumerator()
        {
            return _data.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
    }


}


Measured memory_bytes: 13396