You have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn't have the same color. What maximum number t of tables can be decorated if we know number of balloons of each color?Your task is to write a program that for given values r, g and b will find the maximum number t of tables, that can be decorated in the required manner.

The single line contains three integers r, g and b (0 ≤ r, g, b ≤ 2·109) — the number of red, green and blue baloons respectively. The numbers are separated by exactly one space.

Print a single integer t — the maximum number of tables that can be decorated in the required manner.

NoteIn the first sample you can decorate the tables with the following balloon sets: "rgg", "gbb", "brr", "rrg", where "r", "g" and "b" represent the red, green and blue balls, respectively.

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    vector<long long int>v;
    long long int a, b, c,  r = 0, mxm, mnm;
    for(int i = 0; i < 3; i++)
    {
        cin >> a;
        r += a;
        v.push_back(a);
    }
    sort(v.begin(), v.end());

    if(v[2] > 2 * (v[0] + v[1]))
        cout << (v[0] + v[1]);
    else
        cout << r / 3;

    return 0;
}

#include <cctype>
#include <iostream>
#include <fstream>
#include <string.h>
#include <algorithm>
#include <vector>
#include <math.h>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <string>
#include <stack>
#include <iterator>
#define forn(i , n) for (int i = 0; i < n; ++i)
#define down(i, n) for (int i = n - 1; i >= 0; --i)
#define inf 100000007
#define eps 1e-14
using namespace std;
typedef unsigned long long u64;
typedef long long i64;
typedef vector<int> vint;
typedef vector<i64> vi64;
typedef vector < vector < int > > graph;    // +h-wl7xi // izh_camp04
typedef pair<int, int> pint;
typedef pair<i64, i64> pi64;
typedef int huint;

ifstream in("input.txt", ios::in);
ofstream out("output.txt", ios::out);

int main()
{
    i64 sum=0;
    vi64 v(3);
    forn(i, 3)
        cin >> v[i];
    sort(v.begin(),v.end());
    if (v[2]/2>v[0]+v[1])
        cout << v[0]+v[1];
    else cout << (v[0]+v[1]+v[2])/3;

}

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	long long r, g, b;
	cin >> r >> g >> b;
	if (r > b)
		swap(r, b);
	if (g > b)
		swap(g, b);
	long long max_tables = (r + g + b) / 3;
	cout << min(max_tables, (r + g));
	//system("pause");
	return 0;
}

#include <bits/stdc++.h>
#define lli long long int
using namespace std;

lli ballons[3];

int main()
{
  scanf("%lld %lld %lld", &ballons[0], &ballons[1], &ballons[2]);
  sort(ballons, ballons+3);
  printf("%lld\n", min((ballons[0] + ballons[1] + ballons[2]) / 3, ballons[0] + ballons[1]));

  return(0);
}
// - ((ballons[0] == ballons[1] && !(ballons[0] & 1)) || ballons[0] == 1))

#include<bits/stdc++.h>
#define int         long long
#define ip(x)        int x; cin>>x;
#define aray(a,n)    int a[n]; fo(i,n){cin>>a[i];}
#define ll 			long long
#define MaX(a,n)    *max_element(a,a + n)
#define pb          push_back
#define	endl		'\n'
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(int i=a;a<b?i<b:i>b;a<b?i++:i--)
#define fo(i,n)	    for(int i=0;i<n;i++)
#define lbnd        lower_bound
#define mem0(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,-1,sizeof(a))
#define memf(a) memset(a,false,sizeof(a))
#define ubnd        upper_bound

#define fre(a,v)    upper_bound(all(a),v)-lower_bound(all(a),v);

#define bs          binary_search
#define mp          make_pair
#define itr(it,a)   for(auto it=a.begin();it!=a.end();it++)
#define setp(x,pre)   fixed<<setprecision(pre)<<x
#define noofonebit(x)   __builtin_popcountll(x)
#define noofzerofromrightbit(x) __builtin_ctzll(x)
int mod=1000000007;
void normalize(int &a){a=(a+mod)%mod;}
int modmul(int a,int b){a=a%mod;b=b%mod;normalize(a);normalize(b);return (a*b)%mod;}
int modadd(int a,int b){a=a%mod;b=b%mod;normalize(a);normalize(b);return (a+b)%mod;}
int modsub(int a,int b){a=a%mod;b=b%mod;normalize(a);normalize(b);return (a-b+mod)%mod;}
int me(int x,int n){x%=mod;if(n==0)return 1;int u=me(x,n/2)%mod;u=(u*u)%mod;if(n%2)u=(u*x)%mod;return u;}
int ipow(int x,int n){if(n==0)return 1;int u=ipow(x,n/2);u=(u*u);if(n%2)u=(u*x);return u; }
int logb(int a,int b){int ans=0; while(a>=b) { a/=b; ans++; } return ans;}
int gcd(int a,int b){ if(b==0)return a; return gcd(b,a%b); }
int lcm(int a,int b){return (a/gcd(a,b))*b;}
bool isprime(int n){for(int i=2;i*i<=n;i++){if(n%i==0){ return false;}}if(n==1)return false; return true;}
using namespace std;
template<typename T, typename U> static inline void amin(T &x, U y){ if(y<x) x=y; }
template<typename T, typename U> static inline void amax(T &x, U y){ if(x<y) x=y; }

void solve()
{
ip(a); ip(c); ip(b);
cout<<min(min(min(a+b,b+c),a+c),(a+b+c)/3);
}
signed main(){
   ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int t=1;
   //cin>>t;
    while(t--)  {solve();
    cout<<"\n";
   }
    return 0;
}

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
struct sub{
    int len;
    pair<int,int> p;

};

int main() {
	// your code goes here
//hroo
long long int re,g,b;
cin>>re>>g>>b;
cout<<min((re+g+b)/3,min(re+g,min(g+b,re+b)));
	return 0;
}

#include <iostream>
#include <vector>
#include <queue>
#include <stdio.h>
#include <map>
#include <set>
#include <algorithm>
#define pb push_back
#define mk make_pair
#define sz size
#define fi first
#define se second

using namespace std;

int abk(int a){
	return a < 0 ? -1 * a : a;
}

void cnt(long long &a, long long &b, long long &c){
	long long t = a, p = b, q = c;
	a = max(t, max(p, q));
	c = min(t, min(p, q));
	b = t + q + p - a - c;
}
long long a, b, c, res, q;
int main(){
	cin >> a >> b >> c;
	cnt(a, b, c);
	cerr << a << ' ' << b << ' ' << c << endl;
	if((b + c) * 2 < a)
		cout << (b + c);
	else
		cout << (a + b + c) / 3;
}

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
using ll = long long;

const ll INF = 1e18;
const int MOD = 1e9+7;

int main() {

	cin.tie(NULL);
	ios_base::sync_with_stdio(false);

	ll ans = 0;
	vector<ll> v(3);
	for(auto&q : v) cin >> q;
	sort(v.begin(), v.end());

	if(v[2] >= 2*v[0] + 2*v[1]) ans = v[0] + v[1];
	else {

		ll cnt = (v[1] - v[0])/3;
		ans += 2*cnt;
		v[1] -= 3*cnt;
		v[2] -= 3*cnt;

		cnt = v[1] - v[0];
		if(v[2] - 2*cnt >= 0) {
			ans += cnt;
			v[2] -= 2*cnt;
			v[1] = v[0];
		}

		sort(v.begin(), v.end());
		if(v[2] - v[0] <= 1) ans += v[0];
		else {
			cnt = (v[2] - v[0]) * 2 / 3;
			ans += cnt;
			v[2] -= 2*cnt;
			v[1] -= cnt/2;
			v[0] -= (cnt + 1)/2;
			ans += min({v[2], v[1], v[0]});
		}
	}

	cout << ans << '\n';

	return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{long long a[3];
for (int i=0;i<3;i++) cin>>a[i];
long long ans=0;
sort(a,a+3);
reverse(a,a+3);
if (a[0]>=2*(a[1]+a[2]))
    {cout<<a[1]+a[2]; return 0;}
  else cout<<(a[0]+a[1]+a[2])/3;
return 0;
}

using namespace std;
#include<string.h>
#include <sstream>
typedef long long int ll;
typedef long double ld;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <map>
//#define N 4
//const ll INF = 0x3f3f3f3f;
//const ll INF = 0x3f3f3f3f3f3f3f3f;
#include <queue>
#include <unordered_set>
#include <math.h>
#include <cstring>
#include <bitset>
#include <numeric>
#include <set>
#include <stack>
#include <sstream>
#include <list>
#include <queue>
#include <sstream>
#define PI 3.14159265358979323846264338327950
#define mp make_pair
#define inf 1e9
#define endl '\n'
//#define M 1000000007
//#define N 1000000

int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);

	ll a[3];

	for (ll i = 0; i < 3; i++) {
		cin >> a[i];
	}
	sort(a, a + 3);

	ll ans = 0;
	if (a[2] >= 2 * (a[0] + a[1])) {
		ans = (a[0] + a[1]);
	} else {
		ans = (a[0] + a[1] + a[2]) / 3;
	}

	cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	long long int p[3];
	cin >> p[0] >> p[1] >> p[2];
	sort(p,p+3);
	if(2 * (p[0] + p[1]) <= p[2])cout << p[0]+p[1] << endl;
	else cout << (p[0]+p[1]+p[2]) / 3 << endl;
	return 0;
}

#include<iostream>
#include<string>
#include<fstream>
#include<ostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iomanip>
//#include<array>
#include<sstream>
#include<map>
#include<set>

using namespace std;

int main()
{
   vector<long long> x(3);
   cin>>x[0]>>x[1]>>x[2];
   long long ans=0;
   sort(x.begin(),x.end());

   if (x[0]+x[1]<=x[2]/2)
   {
       cout<<x[0]+x[1];
   }
   else
   {
      cout<<(x[1]+x[2]+x[0])/3;

   }

   return 0;
}

#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define Raghav main

int Raghav()
{
	vector<long long int> v(3);
	long long int ans=0,t;
	cin>>v[0]>>v[1]>>v[2];

	sort(v.begin(),v.end());

	if(v[2]>=2*(v[1]+v[0]))
	ans = v[1]+v[0];

	else
	{
		t=min((v[2]-v[1])/2,v[0]);
		ans=ans+t;
		//cout<<ans<<endl;
		v[2]=v[2]-2*t;
		v[0]=v[0]-t;

		ans=ans+v[0];
		//cout<<ans<<endl;
		v[1]=v[1]-v[0];
		v[2]=v[2]-v[0];
		v[0]=0;
		ans = ans+(v[2]+v[1])/3;

	}
	cout<<ans<<endl;
	return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    long long a, b, c;
    cin >> a >> b >> c;
    long long Max, Mid, Min;
    Max = max(max(a, b), c);
    Min = min(min(a, b), c);
    Mid = a + b + c - Min - Max;
    if (Min + Mid <= Max / 2) cout << Min + Mid;
    else cout << (a + b + c) / 3;
    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long

int main() {
	ll r, g, b;
	cin >> r >> g >> b;
	cout << min(min(min((r+g+b)/3,r+g),b+g),r+b) << endl;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;
int main()
{
    long long a,b,c;
    cin>>a>>b>>c;
    long long sum=a+b+c;
    long long large=max(max(a,b),c);
    sum-=large;
    if(large/2>=sum)
    {
        cout<<sum;
    }
    else
    cout<<(a+b+c)/3;
    return 0;
}

#include <iostream>
#include <algorithm>
#include <fstream>
#include <climits>
#include <cstring>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <utility>
#include <map>
#include <set>

#define pb push_back
#define mp make_pair
#define fs first
#define sc second

#define BIGNUMTEMPLAT
#define GEOMETRYTEMPLAT
#define COMPAR

using namespace std;
typedef long long LLong;
typedef unsigned long long Ull;
const int MaxA=13;
const int MaxB=1;
const int MaxStateNum=1e4+13;
const double eps=1e-9;
const double pi=atan(1.0)*4.0;
const int INF=1e7;
const int MemsetBigNum=127;
const int MemsetSmallNum=9856;

LLong ballons[MaxA];
int main()
{
//    freopen("input.txt","r",stdin);
//    freopen("out2.txt","w",stdout);
//    ios::sync_with_stdio(false);
    while(~scanf("%I64d%I64d%I64d",&ballons[0],&ballons[1],&ballons[2]))
    {
        sort(ballons,ballons+3,greater<int>());
        LLong sum=ballons[0]+ballons[1]+ballons[2];
        if(ballons[0]/2>ballons[1]+ballons[2])
            sum=(ballons[1]+ballons[2])*3;
//            sum-=ballons[0]/2-(ballons[1]+ballons[2]);
        printf("%I64d\n",sum/3);
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){
	vector <long long unsigned> x(3);
	for(int i = 0; i < 3; i++)
		cin >> x[i];
	sort(x.begin(), x.end());
	cout << min(x[0] + x[1], (x[0] + x[1] + x[2]) / 3) << endl;
}

#include <bits\stdc++.h>
using namespace std;

typedef long long ll;

int main(){
    #ifdef LOCAL
    freopen("in.txt", "r", stdin);
    #endif
    ll A[3];
    while(cin>>A[0]>>A[1]>>A[2]){
        sort(A, A+3);
        ll a=A[0], b=A[1], c=A[2];
        if(c>2*a+2*b) c=2*a+2*b;
        ll ans=a+(c+b-2*a)/3;
        cout<<ans<<endl;
    }
    return 0;
}

#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
    ll r,g,b;
    scanf("%I64d%I64d%I64d",&r,&g,&b);
    printf("%I64d\n",min((r+g+b)/3,min(r+g,min(g+b,r+b))));
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b,c,L,MM,res;
    scanf("%I64d%I64d%I64d",&a,&b,&c);
    L=max(a,max(b,c));
    MM=(a+b+c);
    if(L>(2*MM/3))
        res=a+b+c-L;
    else res=MM/3;
    printf("%I64d\n",res);
}

#include<bits/stdc++.h>
using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long int lld;

#define sz                           size()
#define pb                           push_back
#define mp                           make_pair
#define F                            first
#define S                            second
#define fill(a,v)                    memset((a),(v),sizeof (a))
#define INF                          INT_MAX
#define mod 1000000007
#define __sync__		     std::ios::sync_with_stdio(false);

int main()
{
	lld a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	if(a[2]>2*((a[0]+a[1])))
		cout<<a[1]+a[0]<<"\n";
	else cout<<(a[0]+a[1]+a[2])/3<<"\n";
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
long long a , b , c , mx, mn , md , hmd , k , hmx;
int main()
{
    cin >> a >> b >> c;
    cout << min((a + b + c) / 3 , min(a + b , min(b + c , a + c)));
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long int r,g,b,ans=0,k1,k2;
    cin>>r>>g>>b;
    k1=(r+g+b)/3;
    if((k1>=r&& k1>=g) || (k1>=g&& k1>=b) || (k1>=b&& k1>=r))
    {
        if((r+g)<=(b/2))
        {
            cout<<r+g;
            return 0;
        }else
        if((b+g)<=(r/2))
        {
            cout<<b+g;
            return 0;
        }else
        if((r+b)<=(g/2))
        {
            cout<<r+b;
            return 0;
        }

    }
    else
    {
        cout<<k1;
        return 0;
    }

        cout<<k1;
}

#include <iostream>
#include <ostream>
#include <istream>
#include <fstream>
#include <sstream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <limits>
#include <functional>
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <queue>
#include <iterator>
#include <stack>
#include <deque>
#include <numeric>
#include <tuple>
#include <ctime>
#include <array>
#include <random>
#include <iomanip>
#include <typeinfo>
#include <locale>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef double dl;
typedef size_t sz;

typedef pair<int, int> pii;
typedef pair<ll, ll> pl;
typedef pair<ull, ull> pul;

typedef vector<int> vi;
typedef vector<vi> vvi;

typedef vector<sz> vsz;
typedef vector<vsz> vvsz;

typedef vector<unsigned int> vui;
typedef vector<vui> vvui;

typedef vector<long long> vl;
typedef vector<vl> vvl;

typedef vector<unsigned long long> vul;
typedef vector<vul> vvul;

typedef vector<double> vd;
typedef vector<vd> vvd;

typedef vector<string> vs;
typedef vector<vs> vvs;

int ri(){ int r; cin >> r; return r; }
sz rsz(){ sz r; cin >> r; return r; }
unsigned int rui(){ unsigned int r; cin >> r; return r; }
long long rl(){ long long r; cin >> r; return r; }
unsigned long long rul(){ unsigned long long r; cin >> r; return r; }
double rd(){ double r; cin >> r; return r; }

string rss(){ string r; cin >> r; return r; }
string rs(){ string r; getline(cin, r); return r; }

vs rvs(int n)
{
	assert(n);

	vs r;

	for (int i = 0; i < n; ++i)
	{
		string s = rs();
		while (s.empty())
			s = rs();
		r.push_back(s);
	}
	return r;
}

vi rvi(int n){ assert(n); vi r; for (int i = 0; i < n; ++i) r.push_back(ri()); return r; }
vui rvui(int n){ assert(n); vui r; for (int i = 0; i < n; ++i) r.push_back(rui()); return r; }
vl rvl(int n){ assert(n); vl r; for (int i = 0; i < n; ++i) r.push_back(rl()); return r; }
vul rvul(int n){ assert(n); vul r; for (int i = 0; i < n; ++i) r.push_back(rul()); return r; }
vd rvd(int n){ assert(n); vd r; for (int i = 0; i < n; ++i) r.push_back(rd()); return r; }

#define all(cont) (cont).begin(), (cont).end()
#define rall(cont) (cont).rbegin(), (cont).rend()

////////////////////////////////////////////////////////////////////////////////////////////////////

int main()
{
	auto v = rvul(3);
	int r = accumulate(all(v), 0ULL) / 3;
	sort(all(v), greater<ull>());
	if (v[0] > 2 * (v[1] + v[2]))
		r = v[1] + v[2];

/*	while (count(all(v), 0ULL) < 2)
	{
		sort(all(v), greater<ull>());

		if (v[0] >= 2 * (v[1] + v[2]))
		{
			r += v[1] + v[2];
			break;
		}
		else if (v[0] - v[2] <= 1)
		{
			r += v[2];
			break;
		}

		int d1 = (v[0] - v[1]) / 2;
		if (!d1)
			d1 = 1;
		int d2 = v[1] - v[2];
		if (!d2)
			d2 = 1;

		int n = min(d1, d2);
		r += n;

		v[0] -= 2 * n;
		v[1] -= n;
	}*/

	cout << r << endl;

	return 0;
}

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
typedef long long ll;
#define MD 1000000007
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;

int main()
{
    //freopen("H:\\in.txt","r",stdin);
    //freopen("H:\\out.txt","w",stdout);
    ll g[3];
    scanf("%I64d%I64d%I64d", &g[0], &g[1], &g[2]);
    sort(g, g + 3);
    ll ans;
    if ((g[0] + g[1]) * 2 >= g[2])
        ans = (g[0] + g[1] + g[2]) / 3;
    else
        ans = g[0] + g[1];
    printf("%I64d\n", ans);
    return 0;
}

#include<bits/stdc++.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
typedef long long ll;
typedef double dl;
using namespace std;

const int N=2e5+7;
const ll  M=1e9+7;
const int INF=0x3f3f3f3f;

int n,m;
ll a[100];
int read(int &n){
	char ch=' ';
	int q=0,w=1;
	for(;(ch!='-')&&((ch<'0')||(ch>'9'));ch=getchar());
	if(ch=='-') w=-1,ch=getchar();
	for(;ch>='0'&&ch<='9';ch=getchar()) q=q*10+ch-48;
	n=q*w;
	return n;

}

void solve(){

	scanf("%lld%lld%lld",&a[1],&a[2],&a[3]);
	sort(a+1,a+4);
	if(a[3]>=2*(a[1]+a[2]))		printf("%lld\n",a[1]+a[2]);
	else
	{
		a[3]-=a[1];
		a[2]-=a[1];
		ll x=(a[3]+a[2])/3;
		ll maxn1=x+a[1];
		printf("%lld\n",maxn1);
	}
}

int main(){
//	ios::sync_with_stdio(0);
//	cin.tie(0),cout.tie(0);
//	int T; scanf("%d",&T);
//	for(int i=1;i<=T;i++)
		solve();
}

#include <bits/stdc++.h>

using namespace std;
int main()
{
    long long arr[3];
    for(int i = 0 ; i < 3; i++)
        cin>>arr[i];
    sort(arr,arr+3);
    cout<<min((arr[0]+arr[1]+arr[2])/3,arr[0]+arr[1]);

}

#include <bits/stdc++.h>

using namespace std;
#define ll long long
int main()
{
	ll a, b, c;
	cin >> a >> b >> c;
	ll x = max(a, max(b, c)), y = min(a, min(b, c)), z = a + b + c - x - y;
	if((x >= 2*(y + z)) && (x + y + z >= 3))
		cout << y + z;
	else
		cout << (a + b + c)/3;

}

#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    unsigned long long r(0),g(0),b(0);
    cin >> r >> g >> b;
    unsigned long long buf;
    if(r<g){buf = r ; r = g; g = buf;}
    if(g<b){buf = g ; g = b; b = buf;}
    if(r<g){buf = r ; r = g; g = buf;}
    unsigned long long res(0);
    //res = (b / 3)*3;
    unsigned long long div(0);
    // r -= res; g -= res; b -= res;    2000000000  1000000000
    div = (g / 3)?g/3:1;
    while(r*g + g*b + b*r > 9 * div *div){
        if(r - b >= div){
            r-=2 * div;
            g-= div;
            res += div;
        }else{
            r-= div;
            g-= div;
            b-= div;
            res += div;
        }
        if(r<g){buf = r ; r = g; g = buf;}
        if(g<b){buf = g ; g = b; b = buf;}
        if(r<g){buf = r ; r = g; g = buf;}
        div = (g / 3)?g/3:1;
    };

     while(r*g + g*b + b*r > 1){
        if(r - b >= div){
            r-=2 * div;
            g-= div;
            res += div;
        }else{
            r-= div;
            g-= div;
            b-= div;
            res += div;
        }
        if(r<g){buf = r ; r = g; g = buf;}
        if(g<b){buf = g ; g = b; b = buf;}
        if(r<g){buf = r ; r = g; g = buf;}
    };

    cout << res << endl;
    return 0;
}

/*
1 2000000000 1000000000
*/

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	vector<long long> a;
	for (int i = 0; i < 3; i++) {
		long long temp;
		cin >> temp;
		a.push_back(temp);
	}
	sort(a.begin(), a.end());
	if (2 * (a[0] + a[1]) <= a[2]) cout << a[0] + a[1];
	else cout << (a[0] + a[1] + a[2]) / 3;
	return 0;
}

#include <iostream>
#include <cstdlib>
using std::cout;
using std::cin;

int compare (const void * a, const void * b);
unsigned int ball(unsigned *rgb);

int main()
{
    unsigned rgb[3];
    cin >> rgb[0] >> rgb[1] >> rgb[2];
    qsort(rgb, 3, sizeof(rgb[0]),compare);

    cout<<std::endl;
    cout << ball(rgb);
    return 0;
}

unsigned ball(unsigned *rgb)
{

    return (rgb[0]/2) >= rgb[1] + rgb[2] ? rgb[1] + rgb[2] : (rgb[0]/3. + rgb[1]/3. + rgb[2]/3.);
}
int compare (const void * a, const void * b)
{
  return ( *(int*)b - *(int*)a );
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
	long long int a,b,c;
cin>>a>>b>>c;
	 cout<<min((a+b+c)/3,min(a+b,min(b+c,a+c)));

	return 0;
}

#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define rep(i, s, e) for(int i = s; i < e; i ++)
typedef long double ld;
const int maxN = 100*1000 +5;
const int mod = 1000*1000*1000+7;
const int maxM = 400000;

ll ans=0;
ll x,y,z;

int main()
{
    ios::sync_with_stdio(0); cin.tie();

    std::vector<ll> v(3);
    for (size_t i = 0; i < 3; i++) {
      cin>>v[i];
      ans+=v[i];
    }
    // cout<<ans<<endl;
    sort(v.begin(),v.end());
    ans=ans/3;

    // cout<<ans<<endl;
    if(ans > v[0]+v[1]){
      // cout<<ans<<endl;
      // cout<<v[0]<<endl;
      // cout<<v[1]+v[0]<<endl;
      ans=v[0]+v[1];
      // cout<<ans<<endl;
    }
    cout<<ans<<endl;
    return 0;
}

#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
    long long int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    cout<<min((a[0]+a[1]+a[2])/3,a[0]+a[1]);
}

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long r,g,b;
    cin>>r>>g>>b;
    cout<<min((r+g+b)/3,min(r+b,min(b+g,r+g)));
}

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
    long long a[10]={0};

    long long i,count1=0,a1,b,c;
    scanf("%I64d%I64d%I64d",&a1,&b,&c);
   a[0]=(a1+b+c)/3;
   a[1]=a1+b;
   a[2]=a1+c;
   a[3]=b+c;
    sort(a,a+4);
    printf("%I64d\n",a[0]);
    return 0;
}
/*2018-02-05 20:12:24.675*/

#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iterator>
#include <ctime>

typedef unsigned int uint32;
typedef signed long long int64;
typedef unsigned long long uint64;

using namespace std;

#define ALL(a) a.begin(), a.end()
#define FOR(a) for (int i = 0; i < (a); ++i)
#define D(a) #a << ": " << a << "\n"

int main()
{
    vector<int64> arr(3);
    cin >> arr[0] >> arr[1] >> arr[2];
    sort(ALL(arr));
    if (2*(arr[0]+arr[1]) <= arr[2])
        cout << arr[0] + arr[1] << endl;
    else
        cout << (arr[0]+arr[1]+arr[2])/3 << endl;

    return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
typedef long long int ll;

int main()
{
	ll c[3];
	cin >> c[0] >> c[1] >> c[2];
	sort(c,c+3);
	if(c[2] >= 2*(c[0] + c[1])) cout << (c[0] + c[1]) << endl;
	else cout << (c[0] + c[1] + c[2])/3;
	return 0;
}

#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdio>
#include<stdlib.h>
#include<sstream>
#include<list>
#include<math.h>
#include<map>
#include<set>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<fstream>
#include<vector>
#include<algorithm>
#include <queue>
#include<string>
#include<cstring>
#include <deque>
#include<stack>
#include <array>
using namespace std;

#define ALL(a) a.begin(),a.end()
#define CLR(a) memset(a,0,sizeof(a))
#define PB push_back
#define PI acos(-1.0)
#define SET(a) memset(a,-1,sizeof(a))
#define ALL_BITS ((1 << 31) - 1)
#define NEG_BITS(mask) (mask ^= ALL_BITS)
#define TEST_BIT(mask, i) (mask & (1 << i))
#define ON_BIT(mask, i) (mask |= (1 << i))
#define OFF_BIT(mask, i) (mask &= NEG_BITS(1 << i))
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
long long GCDFast(long long a, long long b){ while (b)b ^= a ^= b ^= a %= b;  return a; }
#define MOD 1000000007
#define MX 100010
#define pii pair<int,int>
#define LL long long
// UP, RIGHT, DOWN, LEFT, UPPER-RIGHT, LOWER-RIGHT, LOWER-LEFT, UPPER-LEFT
int dx[8] = { -1, 0, 1, 0, -1, 1, 1, -1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };

/*
#define N 200000002
bool prime_number[N];
long long prime_num[11078937];
int size;
void prime()
{
int i = 0 ,limit = (int)sqrt((double)N), x = 0,j = 0,y;
memset(prime_number,true,sizeof(prime_number));
for(x = 2 ; x <= limit; x++)
{
if(prime_number[x] == true)
{
y = N/x;
for(i = 2 ; i <= y ;i++)
prime_number[i*x] = false;
}
}
for(x = 2,i = 0 ; x <= N; x++)
if (prime_number[x])
{
prime_num[i] = x;
i++;
}
size = i;
}

//binary search
int Number;
int binarySearch(int key){
int low = 0, high = Number - 1, mid;
while (low < high){
mid = a[low] + a[high];
if (a[mid] == key){

}
if (a[mid] < key)
low = mid + 1;
else
high = mid;
}
if (a[low] == key)
return low;
return -1;//not found
}
*/

int main() {
	//freopen ("d:/Codejam/B-small-attempt0.in","r",stdin);
	//freopen ("d:/Codejam/output1.txt","w",stdout);
	int n, i, j, k, temp, m;
	LL x, y, z, sum, test_case = 0, length, ans, test = 0, l, w, num;
	string  str, str1, str2;
	i = 1;

	LL r, g, b;

	while (cin >> r >> g >> b){
		LL zero = 0;
		if (!r) zero++;
		if (!g) zero++;
		if (!b) zero++;

		if (zero >= 2)
			cout << "0\n";
		else{
			vector<LL>X;
			X.push_back(r); X.push_back(g); X.push_back(b);
			sort(X.begin(), X.end());

			if ((X[0] + X[1]) * 2 <= X[2])
				cout << X[0] + X[1] << "\n";
			else
				cout << (X[0] + X[1] + X[2]) / 3 << "\n";

		}

	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int a,b,c,d=0;
	long long int ar[3];
    cin>>ar[0]>>ar[1]>>ar[2];
	sort(ar,ar+3);
    if(ar[0]==0 && ar[1]==0)
        cout<<0;
    else if(ar[2]>=2*(ar[0]+ar[1]) )
        cout<<ar[0]+ar[1];
    else
        cout<<(ar[0]+ar[1]+ar[2])/3;
}

#include <iostream>
#include <algorithm>
#include <cstring>
#include <stdio.h>
#include <math.h>
#include <string>
#include <vector>
#include <time.h>
#include <stack>
#include <list>
#include <queue>
#include <set>
#include <map>

using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

    vector<long long> xs(3);

    cin >> xs[0] >> xs[1] >> xs[2];

    sort(xs.begin(), xs.end());

    long long c = min(xs[2], 2 * (xs[0] + xs[1]));

    cout << (xs[0] + xs[1] + c) / 3;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    long long int a[3];
    long long int ans=0;
    for(int i=0;i<3;i++){
        cin>>a[i];
    }
    sort(a,a+3);

    ans=(a[0]+a[1]+a[2])/3;
    ans=min(ans,a[0]+a[1]);
    cout<<ans;
    return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
long long a[5];
long long min(long long x,long long y)
{return x<y?x:y;}
int main() {
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    cout<<min((a[0] + a[1] + a[2]) / 3, a[0] + a[1]);
}

#include<iostream>
#include<algorithm>
#define ll long long int
using namespace std;
int main(){
  ll c[3];
  cin>>c[0]>>c[1]>>c[2];
  sort(c,c+3);
  cout<<min((c[0]+c[1]+c[2])/3,c[0]+c[1])<<endl;
  return 0;
}

#include <iostream>
#include <utility>
#include <iterator>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <set>
#include <fstream>
#include <string>
#include <sstream>
#include <cmath>
#include <numeric>
#include <stack>
/*
    ////                            \\\\
    (upper_bound(mas,mas+n,k)-mas)
    ეს აპერ... აბრუნებს იმ პირველივეშემხვედრ
    ელემენტის იტერატორს, რომელიც მეტია ამ
    ველიუზე ამ შემხვევაში კ-ზე, ის 2 არგუმენტი,
    ფირსტ,ლასტ დიაპაზონია;
    და ვაკლებ სახელს, რადგან ინტებზე დავიყვანო,
    //სატთან პირველი ელემენტი მე ნული მაქვს და
    //ეგეცაა გასავალისწინებელი
    \\\\                            ////
    pair<int,int>p{1,3};
    vector<int>v={1,2,3,89};

    for(au,to i:v)
    cout<<i<<i<<" ";
    cout<<__gcd(18, 27);
*/
using namespace std;

int main()
{
     //ifstream ifs("t.txt");
    long long t(0),mas[3];
    for(int i=0;i<3;i++)
    cin>>mas[i];

    sort(mas,mas+3);

    //else t+=mas[2]-t;

    if((mas[0]+mas[1])<=mas[2]/2)
    {
        t=mas[0]+mas[1];
    }
    else
    {
        t=(mas[1]+mas[2]+mas[0])/3;
    }
    cout<<t;
	return 0;

}

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

template<class T>
T Min( T a, T b )
{
	if( a < b )
		return a;
	return b;
}

int main()
{
	long long R, G, B;

	while( cin >> R >> G >> B )
	{
		long long a = R + G;
		long long b = R + B;
		long long c = G + B;
		long long Ans = (R + G + B) / 3;
		Ans = Min( Ans, a );
		Ans = Min( Ans, b );
		Ans = Min( Ans, c );

		cout << Ans << endl;
	}
	return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{long long a[3];
for (int i=0;i<3;i++) cin>>a[i];
long long ans=0;
sort(a,a+3);
reverse(a,a+3);
if (a[0]>=2*(a[1]+a[2]))
    {cout<<a[1]+a[2]; return 0;}
  else cout<<(a[0]+a[1]+a[2])/3;
return 0;
}

#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
    long long int n,m,i,j,t;
    long long int s;
    long long int a[3];
    while(~scanf("%lld",&a[0]))
    {
        s=0;
        scanf("%lld%lld",&a[1],&a[2]);
        for(i=0;i<2;i++)
        {
            for(j=0;j<2-i;j++)
            {
                if(a[j]>a[j+1])
                {
                    t=a[j];
                    a[j]=a[j+1];
                    a[j+1]=t;
                }
            }
        }
        if(a[0]+a[1]<a[2]/2)
        {
            s=a[0]+a[1];
        }
        else
        {
            s=(a[0]+a[1]+a[2])/3;
        }
        printf("%lld\n",s);
    }
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
	vector<long long> a(3);
	long long sum = 0;
	for (long long i = 0; i < 3; i++) {
		cin >> a[i];
		sum += a[i];
	}
	sum /= 3;
	sort(a.begin(), a.end());
	if (sum > a[0] + a[1]) sum = a[0] + a[1];;
	cout << sum;
	return 0;
}

#include <iostream>
#include<bits/stdc++.h>
#define ll long long
#define read freopen("in.in","r",stdin)
#define write freopen("out.out","w",stdout)
#define fr first
#define sc second
#include <sstream>
using namespace std;

ll r , g , b ;
vector <ll> ve;
void Read ()
{
    scanf("%I64d %I64d %I64d", &r , &g ,&b);
    ve.push_back(r) , ve.push_back(g), ve.push_back(b);
    return ;
}

int solve()
{
    sort(ve.begin(),ve.end());

    ll ans = (r + g + b)/3;

    printf("%I64d\n" ,  min (ve[0] + ve[1] , ans ) );

    return 0;

}
int main()
{
    //int i = 26 ;  while(i--)
    Read() , solve() , ve.clear();;
//cout << ve[i] <<endl;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
	long long int a,b,c;

cin>>a>>b>>c;

	 cout<<min((a+b+c)/3,min(a+b,min(b+c,a+c)));

	return 0;
}

#include <iostream>
#include <algorithm>
#include <string.h>
#include <fstream>
#include <string>
#include <iomanip>
#include <vector>
#include <queue>
#include <cmath>

using namespace std;

const int INF = 1e9 + 9;

int main()
{
	//ifstream cin("in.txt");
	long long a[3];
	for (int i = 0; i < 3; ++i)
		cin >> a[i];
	sort(a, a + 3);
	long long res = (2*(a[0] + a[1]) > a[2] ? (a[0] + a[1] + a[2])/3 : a[0] + a[1]);
	cout << res;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}

int main(){

  fastStream();
  // cin>>R>>G>>B;
  vector<ll> v;
  for(int i=0;i<3;i++){
    ll t;
    cin>>t;
    v.push_back(t);
  }
  ll res=0;
  ll tmp=min(v[2],min(v[0],v[1]));
  for(int i=0;i<3;i++)v[i]-=tmp;
  res+=tmp;
  sort(v.begin(),v.end());
  if(v[2]==0){
    cout<<res<<endl;
  }
  else if(v[1]==0){
    ll sum=v[2];
    if(sum>=3){
      res+=min(sum/3,tmp);
    }
    cout<<res<<endl;
  }
  else{
    ll x=min(min(v[2]-v[1],v[1]),v[2]/2);
    v[2]-=x*2;
    v[1]-=x;
    res+=x;
    if(v[2]>0&&v[1]>0){
      ll tmp2=min(v[2]/3,v[1]/3)*3;
      res+=tmp2/3*2;
      v[2]-=tmp2;
      v[1]-=tmp2;
      if(v[1]>v[2])
        swap(v[1],v[2]);
      if(v[2]>=2&&v[1]>=1){
        v[2]-=2;
        v[1]--;
        res++;
        if(v[1]>v[2])
          swap(v[1],v[2]);
      }

    }
    ll sum=0;
    for(int i=0;i<(int)v.size();i++){
      sum+=v[i];
    }
      if(sum>=3){
        res+=min(sum/3,tmp);
      }

    cout<<res<<endl;
  }

  return 0;
}

/**
* I love coding
* @Author: Jecvay
*/

#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <stack>

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define DBG 1
#define ast(b) if(DBG && !(b)) { printf("%d!!|\n", __LINE__); system("pause"); }
#define dout DBG && cout << __LINE__ << ">>| "

inline int gint() {int n;scanf("%d", &n);return n;}
inline char gchar() {char c;scanf("%c", &c);return c;}
//////////////////

#define inf 0x4F4F4F4F
const int maxn = 1e5 + 10;

int a[3];

/////////////////

int dfs(int a, int b, int c) {
  if (b < c) swap(b, c);
  if (a < b) swap(a, b);
  if (b < c) swap(b, c);

  int z = 0;

  if (a * b + a * c + b * c == 0) return 0;

  if (a == b && b == c || (a - b <= 2 && b == c) || (a == b && a - c <= 2)) {
    a -= c;
    b -= c;
    z = c;
    c = 0;
    if (z == 0) {
      if (a == 2) return 1;
      return 0;
    }
    z += dfs(a, b, c);
  } else if (a == b && b-c >= 3) {   // -3 -3  0 ---> 2
    int x = (b-c+2) / 3;
    x = min(x, b / 3);
    a -= 3 * x;
    b -= 3 * x;
    z = 2 * x + dfs(a, b, c);
  } else if (b == c && a-b >= 3) {  // -4 -1 -1 ---> 2
    int x = (a-b+2) / 3;
    x = min(x, a/4);
    x = min(x, b);
    a -= 4 * x;
    b -= x;
    c -= x;
    ast(a >= 0 && b >= 0 && c >= 0);
    z = 2 * x + dfs(a, b, c);
  } else {
    if (a > 1 && b > 0) {
      int x = min((a-c)/2, b-c);
      x = min(x, a-b);
      x = min(x, a/2);
      x = min(x, b);
      a -= 2 * x;
      b -= x;
      z = x + dfs(a, b, c);
    }
  }

  return z;
}

void solve() {
  int cnt = 0;
  cout << dfs(a[0], a[1], a[2]) << endl;
}

int main() {
  for (int i = 0; i < 3; i++)
    a[i] = gint();
  solve();
  return 0;
}

/*

1000000000 500000000 500000000
1 2000000000 1000000000
82728372 939848 100139442

*/

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ull> vi;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	vi v(3);
	cin >> v[0] >> v[1] >> v[2];
	sort(v.begin(), v.end());

	if ((v[0] + v[1]) * 2 >= v[2]) cout << (v[0] + v[1] + v[2]) / 3;
	else cout << v[0] + v[1];
}

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <complex>
#include <ctime>
#include <cassert>
#include <functional>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;

#define REP(i,s,t) for(int i=(s);i<(t);i++)
#define FILL(x,v) memset(x,v,sizeof(x))

const int INF = (int)1E9;
#define MAXN 100005

int main(){
	int a[3];
	REP(i, 0, 3) cin >> a[i];
	int ans = 0;
	while (1){
		sort(a, a + 3);
		if (a[0] == 0 && a[1] == 0) break;
		if (a[2] - a[0] <= 1) {
			ans += a[0];
			break;
		}
		if (a[1] > a[0]){
			if (a[1] != a[2]){
				int b = a[2] - a[1];
				b = min(b, (a[2] - a[0]) / 2);
				b = min(b, a[1] - a[0]);
				a[2] -= 2 * b;
				a[1] -= b;
				ans += b;
			}
			else{
				int d = a[1] - a[0];
				d /= 3;
				a[1] -= d * 3;
				a[2] -= d * 3;
				ans += 2 * d;
				if (d == 0){
					a[1] -= 1;
					a[2] -= 2;
					ans++;
				}
			}
		}
		else {
			int b = min(a[0], (a[2] - a[0])/3);
			a[0] -= b;
			a[1] -= b;
			a[2] -= 4 * b;
			ans += 2 * b;
			if (b == 0){
				a[0] --;
				a[2] -= 2;
				ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

#include<iostream>
#include <iomanip>
#include<fstream>
#include<time.h>
#include<math.h>
#include<limits.h>
#include<vector>
#include<map>
#include<stdio.h>
#include<cstdlib>
#include<string.h>
#define i(a) for(int i=0;i<a;i++)
#define j(a) for(int j=0;j<a;j++)
#define debug cout<<"here"<<endl
#include<complex>
#include<algorithm>
#include<queue>
#include<climits>
#include<unordered_set>
#include<stack>
#include<setjmp.h>
#include <functional>
#include<list>
#include<set>
#define Ceil(a) ((a+b-1)/b)
#define Round(a) ((a+b/2)/b)
#define oo INT_MAX-1
using namespace std;
#ifdef ASD
    #define fin cin
    #define fout cout
#else
    ifstream fin("frac1.in");
    ofstream fout("frac1.out");
#endif // ASD
// fabs(a-b)<=1e-8  1LL<<60
//std::ios_base::sync_with_stdio(false);
//cin.tie(0);
//cout.tie(0);
class compare : public std::binary_function<double,double,bool>
{public:compare( double arg = 1e-7 ) : e(arg) {}bool operator()( const double &left, const double &right  ) const
{return (abs(left - right) > e) && (left < right);}double e;};
//inline long long myabs(long long a){return (a<0)?-a:a;}
inline int d_compare(double x,double y){return (fabs(x-y)<=1e-7)?0:(x>y)?1:-1;}
inline int mod(long long x,int y){if(y==0)return x;if(x<0)x=-x;if(x>=y)x%=y;return x;}
inline int cmod(int x,int y){if(y==0)return x;if(x<0)x+=(abs(x)/y+1)*y;if(x>=y)x=x%y;return x;}
int Bcount(int mask){int n=0;while(mask)n+=((mask&-mask)!=0),mask&=~(mask&-mask);return n;}
inline bool Bstate(int mask,int idx){return (mask&(1<<idx));}
inline int B1(int mask,int idx){return mask|(1<<idx);}
inline int B0(int mask,int idx){return mask&~(1<<idx);}
inline int drift(int mask,int n){return mask&((1<<n)-1);}
void debugmask(int mask,int n){i(n)cout<<Bstate(mask,i);}
int dr[4]={0,0,-1,1},dc[4]={-1,1,0,0};
typedef long long ll;
template<typename Ty>void clear(Ty&q){Ty empty;swap(q,empty);}
typedef pair<int,int> point;
#define x first
#define y second

int main()
{
//    while(1){
    int a,b,c;
    long long t=0;
    cin>>a>>b>>c;
    if(a<c) swap(a,c);
    if(b<c) swap(b,c);
    if(a<b) swap(a,b);
    if(a>>1>=c)
    {
        t+=c;
        a-=c*2;
        c=0;
    }
    if(a>>1>=b)
    {
        t+=b;
        a-=b*2;
        b=0;
    }
    if(b||c)    t+=((ll)a+b+c)/3;
    cout<<t<<endl;
//    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std ;

#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl '\n'

typedef long long int ll ;

void solve()
{
	 ll x , y , z ;
	 cin >> x >> y >> z ;
	 ll ans =0 ;
	 if ( max ( x , max (y , z) ) < 2 * ( x + y + z - max ( x , max( y , z) )) ) ans = (x + y + z) / 3 ;
	 else ans = x + y + z - max(x , max(y , z)) ;
	 cout << ans << endl ;
}

int main()
{
	 ios ;
     solve();
}

#include <iostream>
#include <algorithm>
#include <cstring>
#include <stdio.h>
#include <math.h>
#include <string>
#include <vector>
#include <time.h>
#include <stack>
#include <list>
#include <queue>
#include <set>
#include <map>

using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

    vector<long long> xs(3);

    cin >> xs[0] >> xs[1] >> xs[2];

    sort(xs.begin(), xs.end());

    long long c = min(xs[2], 2 * (xs[0] + xs[1]));

    cout << (xs[0] + xs[1] + c) / 3;

    return 0;
}

#include<iostream>
#include<stack>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<ctime>
#include<math.h>
#include<functional>
#include<cstring>
#include<iomanip>
#include<set>
#include<utility>
#include<limits.h>
#include<stdio.h>
typedef long long ll;
//ֻ�������ӵĸ���Ϊ2��ʱ��2��Ҳſ���Ӯ������1���һ������д��2�������ӵĻ���2����޷�����
using namespace std;
const int maxn = 1e5+10;
const int mod = 1e9 + 7;
const int inf = 0x3fffffff;
/*ll gcd(ll a, ll b)//���Լ��
{
return b == 0 ? a : gcd(b, a%b);
}
ll lcm(ll a, ll b)
{
return a / gcd(a, b)*b;
}
ll fast_pow(ll a, ll k)//������
{
ll ans = 1;
while (k != 0)
{
if (k & 1) ans = (ans*a) % mod;
k >>= 1;
a = (a*a) % mod;
}
return ans;
}
ll C(ll n, ll m)//��������ж�
{
ll ans = 1;
for (int i = 1;i <= m;i++)
ans = ans*(n - m + i) / i;
return ans;
}
bool is_prime(ll x)//�����ж�
{
if (x == 2 || x == 3) return true;
if (x % 6 != 1 && x % 6 != 5) return false;
ll temp = sqrt(1.0*x);
for (ll i = 5;i <= temp;i += 6)
if (x%i == 0 || x % (i + 2) == 0) return false;
return true;
}
int prime[maxn], pnum = 0;//������pnum������
bool p[maxn] = { 0 };//�����ɸ������Ϊtrue
void Find_Prime()//�����ɸѡ��������һ���������Ͱ����ı���ȫ��ɸ��
{
for (int i = 2;i < maxn;i++)
{
if (p[i] == false)//�����Ͳ���һ����һ�������ж�������
{
prime[pnum++] = i;
for (int j = i + i;j < maxn;j += i)//ɸ�������ı���
p[j] = true;
}
}
}*/
ll r, g, b;
ll a[3];
int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	if (a[0] + a[1] >= a[2]/2)
		cout << (a[0] + a[1] + a[2])/3;
	else cout << a[0] + a[1];
	return ~~(0 - 0);
}

#include <iostream>
#include <time.h>
#include <vector>
#include <stdio.h>
#include <memory.h>
#include <string>
#include <map>
#include <algorithm>
#include <bitset>
#include <queue>
#include <set>
#include <time.h>
#include <assert.h>
#include <sstream>
//#include <unordered_map>
#include <bitset>
#include <utility>
#include <iomanip>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#if !ONLINE_JUDGE
#include "inc.h"
#endif
using namespace std;
typedef long long ll;

int main() {
#if !ONLINE_JUDGE
    freopen("a.txt", "r", stdin);
    //freopen("a.txt", "w", stdout);
    decTime;
#endif

    ll a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    cout<<min((a[0]+a[1]+a[2])/3,a[0]+a[1]);

#if !ONLINE_JUDGE
    printTime;
#endif
    return 0;
}

#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <stdio.h>
#include <cstring>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <set>
#include <map>

using namespace std;

#define all(p) (p).begin(), (p).end()
#define odd(x) ((x)&(1))
#define fi first
#define se second

typedef long long ll;

const int N = 1111111;
const int INF = 1000000000, mod = 1000000007;

int main() {

    ll r, g, b;
    scanf("%I64d%I64d%I64d", &r, &g, &b);
    printf("%I64d\n", min(min((r+g+b)/3, r + g), min(g + b, r + b)));

    return 0;
}

#include<cstdio>
#include<algorithm>
using namespace std;

long long a[3];
int main()
{
	scanf("%I64d %I64d %I64d", a+0, a+1, a+2);
	sort(a, a+3);
	long long ans;
	if ((a[0] + a[1]) * 2 < a[2]) ans = a[0] + a[1];
	else ans = (a[0] + a[1] + a[2]) / 3;
	printf("%I64d\n", ans);
	return 0;
}

#include <iostream>
#include <algorithm>

using namespace std;

long long arr[3];

int main(void){

    scanf("%I64d %I64d %I64d",&arr[0],&arr[1],&arr[2]);
    sort(arr, arr+3);

    if (arr[2] >= 2*(arr[0]+arr[1])) {
        printf("%I64d\n",arr[0]+arr[1]);
    }else{
        printf("%I64d\n",(arr[0]+arr[1]+arr[2])/3);
    }

    return 0;
}

#include<bits/stdc++.h>
#define int long long int
#define endl "\n"
#define debug(x) cout << '>' << #x << ':' << x << endl;
#define mem(a,b) memset(a,b,sizeof(a))
#define loop(i,n) for(int i=0;i<(n);i++)
#define fors(a,b,i) for(int i=(a);i<=(b);i++)
#define ford(a,b,i) for(int i=(a);i>=(b);i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fastm_fast ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL)
using namespace std;
const int  mod = 1e9 + 7;
#define pb push_back
#define mp make_pair
#define S second
#define F first
const int MAX = 1e5;
int32_t main()
 {
 fastm_fast;
#ifndef  ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

 		int r , g , b;
 	    cin >> r >> g >> b;

 	    vector<int> v={r,g,b};
 	    sort(all(v));
 	    cout<<min((r+g+b)/3,v[0]+v[1]);
 return 0;
 }

#include<iostream>
#include<stdio.h>
#include<algorithm>
#define ll long long
using namespace std;
int main()
{
   ll a[3];
     for(int i=0;i<3;i++) cin>>a[i];
     sort(a,a+3);
     cout<<min(a[0]+a[1],(a[0]+a[1]+a[2])/3);
     return 0;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long r, g, b;
    scanf("%lld %lld %lld", &r, &b, &g);
    printf("%lld\n", min(min(min((r + g + b) / 3, r + g), r + b), b + g));
}

#include <iostream>
using namespace std;
unsigned long long r, g, b, tmp, R, G;
int main(){
	cin >> r >> g >> b;
	if(b>r){
		tmp=b;
		b=r;
		r=tmp;
	}
	if(g>r){
		tmp=g;
		g=r;
		r=tmp;
	}
	if(b>g){
		tmp=b;
		b=g;
		g=tmp;
	}
	//cout << r << " " << g << " " << b << endl;
	if(b==0){
		if(r==g) cout << (2*r)/3;
		else if(r<2*g)cout << (r+g)/3;
			 else if(r>=2*g) cout << g;
	}
	else{
		R=r-b;
		G=g-b;
		if(!G) {
			if(b>=R/3) cout << b+R/3;
			else cout << 2*b;
			return 0;
		}
		if(R==G) cout << b+(2*R)/3;
		else if(R<2*G)cout << b+(R+G)/3;
			 else if(R>=2*G){
					if((R-2*G)/3<=b) cout << b+(R+G)/3;
					else cout << b+G+b ;
				  }
	}
	return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>

using namespace std;
int main() {
	vector<long long int> v(3);
	scanf("%I64d %I64d %I64d", &v[0], &v[1], &v[2]);
	sort(v.begin(), v.end());
	if(v[2]/2 >= v[0]+v[1]) printf("%I64d\n", v[0]+v[1]);
	else printf("%I64d\n", (v[0]+v[1]+v[2])/3);
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main() {
  long long a[3];
  for (int i = 0; i < 3; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a, a + 3);
  printf("%lld", min((a[0] + a[1] + a[2]) / 3, a[0] + a[1]));
  return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
unsigned long long int c[3], ans = 0;
int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    scanf("%I64d%I64d%I64d", &c[0], &c[1], &c[2]);
    std::sort(c,c+3);
    if ((c[0] + c[1]) < c[2] / 2)
        printf("%I64d",c[0]+c[1]);
    else printf("%I64d",(c[0]+c[1]+c[2])/3);
}

#include <iostream>
#include <algorithm>
using namespace std;

long long a[5], sol;

int main()
{
    cin>>a[1]>>a[2]>>a[3];
    sort(a+1, a+4);
    if (a[3]>=2*(a[1]+a[2])) cout<<a[1]+a[2]<<'\n';
        else cout<<(a[1]+a[2]+a[3])/3<<'\n';
    return 0;
}

#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <sstream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <stdio.h>
#include <assert.h>
typedef long long ll;
#define mset(a, val) memset(a, val, sizeof(a))
#define up(i, s, t) for (ll i = (s); i < (t); i += 1)
#define down(i, s, t) for (ll i = (s); i > (t); i -= 1)
#define rd1(a) scanf("%d", &a)
#define rd2(a, b) scanf("%d %d", &a, &b)
#define rd3(a, b, c) scanf("%d %d %d", &a, &b, &c)
#define rd4(a, b, c, d) scanf("%d %d %d %d", &a, &b, &c, &d)
#define pii pair<int, int>

using namespace std;
const int MAXINT = 0x70707070;
const ll MAXLONG = (ll) 1 << 60;

int main () {

	ll a, b, c;
	while (cin >> a >> b >> c) {

		ll big = max(a, max(b, c));
		ll res;
		if ( (a + b + c - big) * 2 <= big ) {
			res = a + b + c - big;
		} else {
			res = (a + b + c) / 3;
		}

		cout << res << endl;
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

long long a[3];

bool can(int mid) {
    int x = mid;
    return a[0]+a[1] >= x;
}

int bs(double l, double r) {
    double mid = (l+r) / 2;
    if(fabs(l-r) < 0.01) {
        return round(mid);
    }
    if(can((int)mid) && can((int)mid+1)) return bs(mid, r);
    else if(can((int)mid) && !can((int)mid+1)) return (int)mid;
    else return bs(l, mid);
}

int main() {
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a+3);
    cout << bs(0, (a[0]+a[1]+a[2])/3) << endl;;
    return 0;
}

//In the name of ALLAH

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

#define PB push_back
//#define PB emplace_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mid(l,r) ((r+l)/2)
#define left(node) (node*2)
#define right(node) (node*2+1)
#define mx_int_prime 999999937

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i); }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

struct edge {
    int u, v, w;
};

bool cmp ( const edge &a, const edge &b )
{
    return a.w < b.w;
}

string to_s(int t)
{
  stringstream ss;
  ss << t;
  return ss.str();
}

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};
inline ll max ( ll a, ll b ) { return ( a >= b ) ? a : b; }
inline ll min ( ll a, ll b ) { return ( a <= b ) ? a : b; }
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline ll lcm ( ll a, ll b ) { return ( a * ( b / gcd (a, b) ) ); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

/*
bool seive[1010000];
vi prime;

void seiveGen(int limit) {
    limit += 100;
    int sqrtn = sqrt(limit);
    for(int i = 3; i <= sqrtn; i += 2) {
            if(!seive[i>>1]) {
                    for(int j = i * i; j < limit; j += i + i) {
                            seive[j>>1] = 1;
                    }
            }
    }
    prime.PB(2);
    for(int i = 3; i < limit; i += 2) {
            if(!seive[i>>1]) prime.PB(i);
    }
}
*/

//
//debug
//#ifdef
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

clock_t tStart = clock();
#define timeStamp dbg("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
//#else
//#define dbg(args...)

int main()
{
    optimize();

    ll a[4];
    cin >> a[0] >> a[1] >> a[2];
    sort ( a, a+3 );

    cout << min ( ( a[0] + a[1] + a[2] ) / 3, ( a[0] + a[1] ) );

    return 0;
}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

typedef long long ll;

int main()
{
    ll r,g,b,sum,maxa;
    cin>>r>>g>>b;
    sum=r+g+b;
    maxa=max(max(r,g),b);
    cout<<min(sum/3,sum-maxa)<<endl;
    return 0;
}

#include<set>
#include<map>
#include<list>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<sstream>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<numeric>
#include<utility>
#include<functional>
#include<stdio.h>
#include<assert.h>
#include<memory.h>
#include<bitset>

using namespace std;

int main()
{
    long long r , g , b ;
    cin>>r>>g>>b ;
    cout<<min(min(r+g,r+b),min(g+b,(r+g+b)/3)) ;
}

#include <iostream>
#include<map>
#include<vector>
#include<algorithm>
#include <stdio.h>
#include<set>
#include<string>
#include<math.h>
#include<cmath>
#include<iomanip>
#include<queue>
#include<stack>
#define ll long long
using namespace std;
long double pi = 3.14159265358979323846;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

int main()
{
	ll arr[3];

	cin >> arr[0] >> arr[1] >> arr[2];
	sort(arr, arr + 3);

	cout <<min((arr[0]+arr[1]+arr[2])/3,arr[0]+arr[1]);

	return 0;

}

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main()
{
    __int64 a[3],cn;
    while(~scanf("%I64d%I64d%I64d",&a[0],&a[1],&a[2]))
    {
        cn=a[0]+a[1]+a[2];
        __int64 max=a[0],min=a[0];
        int mx=0,mn=0,zo=0;
        int i=0;
        for(i=1;i<3;i++)
        {
            if(a[i]>max)
            {
              max=a[i];
              mx=i;
            }
            if(a[i]<min)
            {
                min=a[i];
                mn=i;
            }
        }
        if(cn%3!=0)
        {
            a[mx]-=(cn%3);
        }
        for(i=1;i<3;i++)
        {
            if(a[i]>max)
            {
              max=a[i];
              mx=i;
            }
            if(a[i]<min)
            {
                min=a[i];
                mn=i;
            }
        }
        for(i=0;i<3;i++)
        {
            if(i!=mx&&i!=mn)
            {
                zo=i;
            }
        }
        while(a[mx]>2*(a[mn]+a[zo]))
        {
            a[mx]-=3;
            cn-=3;
        }
        cout<<cn/3<<endl;
    }
    return 0;
}

#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAX 100005
#define T printf("***\n");
#define arr0 memset(arr,0,sizeof(arr));
#define arr1 memset(arr,-1,sizeof(arr));
#define for_i for(i=0;i<n;i++)
#define for_j for(j=0;j<n;j++)
#define pf printf
#define cf scanf
int main()
{
	__int64 r,g,b,ans;
	scanf("%I64d%I64d%I64d",&r,&g,&b);
	ans=(r+g+b)/3;
	ans=ans<r+g?ans:r+g;
	ans=ans<b+g?ans:b+g;
	ans=ans<r+b?ans:r+b;
	pf("%I64d",ans);
}

#include <algorithm>
#include <array>
#include <bitset>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(0);

  vector<long long> bs(3);
  cin >> bs[0] >> bs[1] >> bs[2];

  long long sum = accumulate(bs.begin(), bs.end(), 0ll);
  long long remainder = sum % 3ll;
  sort(bs.begin(), bs.end());
  if (remainder >= 1) bs[2]--;
  sort(bs.begin(), bs.end());
  if (remainder >= 2) bs[2]--;
  sort(bs.begin(), bs.end());

  long long new_b0 = min(0ll, max(bs[0], (2ll * bs[0] + 2ll * bs[1] - bs[2]) / 3ll));
  cout << sum / 3ll - new_b0 << endl;

  return 0;
}

#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;

long long a[3],now;
unsigned long long ans;

bool com(int a,int b)
{
	return a>b;
}

int main()
{
	for(int i=0;i<3;i++) cin>>a[i];
	sort(a,a+3,com);
//	cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;
	while(a[1] && a[2])
	{
		now=min(a[0]/2,a[1]);
		a[0]-=2*now;
		a[1]-=now;
		ans+=now;
		sort(a,a+3,com);
		if(!now) break;
	}
	ans+=a[2];
	cout<<ans<<endl;
}

#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>

using namespace std;

long long a[3];

long long fun(long long a, long long b, long long c) {
    if (a >= (a + b + c) / 3) {
        return a;
    }
    if (a == b) {
        if (a == 0) {
            return 0;
        }
        long long l = 1, r = a + 1;
        while (r - l > 1) {
            long long mid = (l + r) / 2;
            if (a - mid <= c - 4 * mid) l = mid;
            else r = mid;
        }
        return fun(a - l, b - l, c - 4 * l) + 2 * l;
    }
    if (b == c) {
        long long l = 0, r = b + 1;
        while (r - l > 1) {
            long long mid = (l + r) / 2;
            if (a <= b - 3 * mid) l = mid;
            else r = mid;
        }
        if (l == 0) {
            return fun(a, b - 2, c - 1);
        }
        return fun(a, b - 3 * l, c - 3 * l) + 2 * l;
    }
    long long l = 0, r = c + 1;
    while (r - l > 1) {
        long long mid = (l + r) / 2;
        if (a <= b - mid && b - mid <= c - 2 * mid) l = mid;
        else r = mid;
    }
    return fun(a, b - l, c - 2 * l) + l;
    return fun(a, b - 1, c - 2) + 1;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    cout << fun(a[0], a[1], a[2]) << endl;
    return 0;
}

#include<iostream>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<string.h>
#include<cmath>
#include<algorithm>
#include<string>
#include<sstream>
#include<stack>
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;

#define pb push_back
#define mp make_pair
#define S second
#define F first
#define all(c) (c).begin(), (c).end()
#define vectorIterate(v) for(auto it=v.begin(); it!=v.end();it++)

ll gcd(ll a, ll b)
{
   if (b==0) return a;
   return gcd(b,a%b);
}

ll abs1(ll a)
{
	if(a<0)
	return -1*a;
	else return a;
}

ll power(ll x, ll y)
{
    ll temp;
    if(y==0)
    return 1;
    temp = power(x, y/2);
    if (y%2 == 0)
    return temp*temp;
    else return x*temp*temp;
}

ll max2(ll a, ll b)
{
	if(a>b)
	return a;
	else return b;
}

ll max3(ll a, ll b, ll c)
{
	max2(max2(a, b), c);
}

ll min2(ll a, ll b)
{
	if(a<b)
	return a;
	else return b;
}

ll min3(ll a, ll b, ll c)
{
	return min2(min2(a, b), c);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	vector<ll> a;
	ll r, g, b;
	cin>>r>>g>>g;
	a.pb(r);
	a.pb(g);
	a.pb(b);
	sort(all(a));
	if(a[2]>2*a[0]+2*a[1])
	a[2]=2*a[0]+2*a[1];
	cout<<(a[0]+a[1]+a[2])/3;
	return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int a[3];
    for(int i=0;i<3;i++){cin>>a[i];}
    sort(a,a+3);
    int t=a[0];
    if(a[1]-a[0]+a[2]-a[0]>=3){
        t+=(a[1]+a[2]-a[0]*2)/3;
    }
    cout<<t;
	return 0;
}

//dhruva24

#include<bits/stdc++.h>

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define all(a) a.begin(),a.end()

using namespace std;
typedef long long int LL;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector< PII > VPII;

int cmpfunc (const void * a, const void * b)
{
	return (*(int *)a - *(int*)b );
}
long long int gcd(long long int m, long long int n)
{
	if(n == 0)
		return m;
	return gcd(n, m % n);
}

long long int fastpow(long long int a, long long int b,long long int m)
{
	long long int r = 1;
	while (b > 0){
		if (b % 2 == 1)
			r = (r * a) % m;
		b = b >> 1;
		a = (a * a) % m;
	}
	return r;
}
int prime(long long int x){
	if(x==1)
		return 0;
	if(x<=3)return 1;
	if(x%6==1||x%6==5){
		long long int y=sqrt(x),i;
		for(i=2;i<=y;i++)
			if(x%i==0)
				return 0;
		return 1;
	}
	return 0;
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    LL r,g,b;
    cin>>r>>g>>b;
    if(r+g+b < 3)
    	cout<<0<<endl;
    else if(r == g && g == b)
    	cout<<r<<endl;
    else {
    	LL first,second,third;
    	if(r>=g && r >= b){
   		 	first = r;
    		if(g>=b)
   		 	{
    			second = g;
    			third = b;
    		}
    		else
    		{
    			second = b;
    			third = g;
    		}
    	}
    	else if(g>=r && g>=b){
    		first = g;
    		if(r>=b){
    			second = r;
    			third = b;
    		}
    		else{
    			second = b;
    			third = r;
    		}
    	}
    	else{
    		first = b;
    		if(r>=g)
    		{
    			second = r;
    			third = g;
    		}
    		else
    		{
    			second = g;
    			third = r;
    		}
    	}
    	if(second == 0 && third == 0)
    		cout<<0<<endl;
    	else if(second+third < first)
    	{
    		if(first/2 > second)
    			cout<<second+third<<endl;
    		else
    			cout<<second<<endl;
    	}
    	else
    		cout<<(first+second+third)/3<<endl;
    }
    return 0;
}

#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cassert>
#include <cstdlib>
#include <cmath>
#include <utility>
#include <algorithm>
#include <map>
#include <climits>
#include <string>
#include <cstring>
#include <fstream>
#include <queue>
#include<set>
using namespace std;
typedef long long ll;
const int INF = 100000000000000LL;
int main(){
	ll r, g, b;
	cin >> r >> g >> b;
	ll res = min(r, min(g,b));
	r -= res; g -= res; b -= res;
	ll m1, m2, t1, t2;
	m1 = max(r, max(g, b));
	//m2 = min(r > 0 ? r : INF, min(b > 0 ? b : INF, g > 0 ? g : INF));
	if (r == 0){
		if (g == 0 || b == 0){
			cout << res << endl;
			return 0;
		}
		else m2 = min(g, b);
	}
	else if (g == 0){
		if (r == 0 || b == 0){
			cout << res << endl;
			return 0;
		}
		else m2 = min(r, b);
	}
	else if (b == 0){
		if (r == 0 || g == 0){
			cout << res << endl;
			return 0;
		}
		m2 = min(r, g);
	}
	while (!(m1<2 || m2<1||m1==INF||m2==INF)){
		m1 -= 2; m2 -= 1;
		t1 = max(m1, m2); t2 = min(m1, m2);
		m1 = t1, m2 = t2;
		res++;
	}
	cout << res << endl;
	//system("pause");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
   int a,b,c;
   cin>>a>>b>>c;
   ll sum = a+b+c;
   int maxx = max(a,max(b,c));
   int minn = min(a,min(b,c));
   int B = sum - minn -maxx;
   if(maxx>=2*(minn+B))cout<<minn+B;
   else {
       cout << sum/3;
   }
   return 0;
}

/*
    Stay motivated and keep working hard
*/
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define fr first
#define mem(arr, val) memset(arr, val, sizeof(arr))
#define sc second
#define sz(v) ((int)(v).size())
#define mp1 make_pair
#define all(a) a.begin(),a.end()
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repd(i,a,p) for(int i=a-1;i>=p;i--)
#define mod 59604644783353249
#define vi vector<int>
#define vp vector<pair<int,int> >
#define ml map<int,int>
#define MPI 3.1415926536
#define in insert
using namespace std;
//CANDIDATE MASTER TOH BNKE RHUNGA
//dsu is pel concept
int n,k=0,t,m,i,j,d,x,s=0;string s1;
bool cmp(string a , string b)
{

}
int modPow(int a, int x, int p)
{
    //calculates a^x mod p in logarithmic time.
    long res = 1;
    while(x > 0)
    {
        if( x % 2 != 0)
        {
            res = (res * a) % p;
        }
        a = (a * a) % p;
        x /= 2;
    }
    return res;
}
int modInverse(int a, int p)
{
    //calculates the modular multiplicative of a mod m.
    //(assuming p is prime).
    return modPow(a, p-2, p);
}

signed main()
{
multiset <int,greater <int> > st;
int x,y,z;
cin>>x>>y>>z;
vi v;
v.pb(x);
v.pb(y);
v.pb(z);
sort(all(v));
cout<<min(v[1]+v[1],(x+y+z)/3);
}

#include <iostream>
#include <algorithm>
#include <cstring>
#include <stdio.h>
#include <math.h>
#include <string>
#include <vector>
#include <time.h>
#include <stack>
#include <list>
#include <queue>
#include <set>
#include <map>

using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

    vector<int> xs(3);

    cin >> xs[0] >> xs[1] >> xs[2];

    sort(xs.begin(), xs.end());

    int ans = xs[0];
    xs[0] -= ans;
    xs[1] -= ans;
    xs[2] -= ans;

    ans += (xs[1] + xs[2]) / 3;

    cout << ans;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define P(x,y) make_pair(x,y)
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define N 200005
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const double EPS = 1e-9;
const double PI = 2*acos(0.0);
const int MAX=1e+5;
int a,b,c,mx,mn,mi,cn=0;
int main (){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>a>>b>>c;
mn=min(a,min(b,c));
mx=max(a,max(b,c));
mi=a+b+c-(mx+mi);
while(mx && mi && mn){
	cn++;mx--;mn--;mi--;
}
if(mx>=2 and mi>=1){
while(mx && mi){
	cn++;mx--;mx--;mi--;
}}
cout<<cn;
	   return 0;}

#include<algorithm>
#include<iostream>
#include<vector>
#include<tuple>
#include<set>
#include<unordered_map>
#include<map>
#include<deque>
#include<stack>
#include<fstream>
#include<numeric>
#include<cassert>
#include<list>

using namespace std;

#define PB push_back
#define MT make_tuple
#define MP make_pair
#define VI vector<int>
#define VVI vector<vector<int>>
#define TII tuple<int,int>
#define SZ() size()
#define ALL(v) v.begin(),v.end()
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORE(v, c) for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define lld long long

#ifdef ONLINE_JUDGE
#define __LLD__ "%I64d"
#else
#define __LLD__ "%lld"
#endif

#define __HALT {while (true) { };}
#define __HOLD__ {char * c = (char *)malloc(100*sizeof(char)); scanf("%s",c); free(c);}
#define __UNSYNC_IO__ ios_base::sync_with_stdio(false);cin.tie(NULL);

#ifdef DEBUG
  #define dbg(vari) cerr<<#vari<<" = "<<(vari)<<endl;
  #define PRINT(a) printf a
#else
  #define dbg(vari) cout<<"";
  #define PRINT(a) (void)(0)
#endif

// #include "/Users/cslusr/macros.h"

class S {
public:

  bool termination(vector<int> & tmp) {
    std::sort(tmp.begin(),tmp.end());
    // ugh. bamboozled by longs again.
    lld sum = (lld)tmp[0] + (lld)tmp[1] + (lld)tmp[2];
    // dbg(sum);
    if ( tmp[0] == 0 && tmp[1] == 0 ) {
      // dbg("what1");
      return true;
    }
    else if ( sum < 3 ) {
      // dbg("what2");
      return true;
    }
    else {
      return false;
    }
  }

  lld solve(int r, int g, int b) {
    lld res = 0;
    int sp1 = std::min({r, g, b });
    res += sp1;
    r -= sp1;
    g -= sp1;
    b -= sp1;

    vector<int> tmp = { r, g, b };
    while ( !termination(tmp) ) { // termination will sort tmp
      // dbg(tmp);
      int lower = tmp[1];
      int higher = tmp[2];

      int sp2 = std::min(lower, higher/2);
      // dbg(sp2);
      res += sp2;
      tmp = { 0, lower - sp2, higher - 2*sp2 };
    }
    // dbg(tmp);
    return res;
  }

  void solve() {
    int r, g, b;
    scanf("%d %d %d\n",&r,&g,&b);

    lld res = solve(r,g,b);

    printf(__LLD__"\n",res);
    fflush(stdout);
  }

};

int main() {

  __UNSYNC_IO__;

  S s;
  s.solve();

  return 0;

}

 #include<bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    ll a[3],t,res=0;
    for(int i=0 ; i<3 ;i++){
        cin>>a[i];
    }
    while(1){
        sort(a,a+3);
        if(a[0] == a[1]){
            res += a[0];
            break;
        }

        if(a[1]  < 1 || a[2] < 2){
            break;
        }
        if(a[0] == 0){
            res += min(a[1],a[2]/2);
            break;
        }
        a[2]-=2;
        a[1]--;
        res++;
    }
    cout<<res;
    return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	long long int r,g,b;
	cin>>r>>g>>b;
	long long int arr[3];
	arr[0]=r;
	arr[1]=g;
	arr[2]=b;
	sort(arr,arr+3);
	if(arr[2]>=2*(arr[1])+arr[0] && arr[1]>arr[0])
	{
		cout<<arr[0]+arr[1]<<endl;
	}
	else
	{
		cout<<(arr[0]+arr[1]+arr[2])/3<<endl;
	}
	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <utility>
#include <set>
#include <iterator>
#include <map>
#include <sstream>
#include <queue>

using namespace std;

int main()
{
    long long a[3];
    for(int i=0;i<3;i++)
    cin>>a[i];
    sort(a,a+3);
    long long ans=a[0];
    a[1]-=a[0];
    a[2]-=a[0];
    if(a[1]+a[2]<3)
    {
        cout<<ans<<endl;
        return 0;
    }
    ans+=a[2]-a[1];
    a[1]-=a[2]-a[1];
    a[2]-=2*(a[2]-a[1]);
    if(a[2]==3)
    ans+=1;
    else
    {
        while(true)
        {
            if(a[2]-3>0)
            {
                ans+=2;
                a[2]-=3;
            }
            else break;
        }
    }
    cout<<ans<<endl;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

#define ms(x,val) memset(x,val,sizeof(x))
#define scan(x) scanf("%d",&x)
#define scanL(x) scanf("%I64d",&x)
#define print(x) printf("%d\n",x)
#define debug(x) printf("DEBUG: %d\n",x)
#define printL(x) printf("%I64d\n",x)
#define ull unsigned long long
#define iii long long
#define pi acos(-1)
#define pb push_back
#define PII pair<int,int>
#define vi vector<int>
#define itr_all(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define MAPL map<long long, int >
#define MAPI map<int,int>
#define MAPP map< pair<int,int> , int>
#define MP make_pair
#define eps 1e-9
#define inf 999999999
#define MAXN 1000009
#define MOD 1000000007 // 10^9 + 7

template < class T > T gcd(T a , T b ) { if(b==0) return a; else return gcd(b, a%b);}
template < class T > T lcm(T a , T b ) { return  a*b / gcd(a, b);}
template < class T > T absolute(T a ) { if(a>0) return a; else return -a;}
inline iii power(iii base,iii p) { iii ans=1; while(p>0) ans*=base,p-=1; return ans;}

int main()
{
//    ios::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);

    iii a[5];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
//    cout<<a[0]<<' '<<a[1]<<' '<<a[2]<<endl;
    iii table=0;
    iii dif;

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

    iii spare=dif/2;
    if(spare>=a[0])
    {
        table+=a[0];
        a[2]-=(a[0]*2);
        a[0]=0;
    }
    else
    {
        a[0]-=spare;
        table+=spare;
        a[2]-=(spare*2);
    }
    sort(a,a+3);

    dif=a[2]-a[1];
    spare=dif/2;

    if(spare>=a[1])
    {
        table+=a[1];
        a[2]-=(a[1]*2);
        a[1]=0;
    }
    else
    {
        a[1]-=spare;
        table+=spare;
        a[2]-=spare*2;
    }
    sort(a,a+3);

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

    if(a[1]) table+=(a[1]+a[2])/3;

    a[2]=a[2]-a[1]+(a[1]%3);
    a[1]=a[1]-a[1]+(a[1]%3);

//    if(a[1]+a[2]>2 && a[1] && a[2]) table++;

    cout<<table<<endl;

    return 0;
}

#include <bits/stdc++.h>
#define maxn
#define f first
#define s second
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair <int,int> p1;
int a[3];
ll kq;

void nhap()
{
    cin>>a[0]>>a[1]>>a[2];
}

void cbi()
{
    sort(a,a+3);
}

void xuli()
{
    if (a[0]==a[1] && a[1]==a[2])
    {
        cout<<a[0];
        exit(0);
    }
    if (a[0]+a[1]<a[2]/2) kq=1ll*a[0]+a[1];
    else kq=1ll*(a[0]+a[1]+a[2])/3;
}

void ghikq()
{
    cout<<kq;
}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("C.inp","r",stdin );
    freopen("C.out","w",stdout);
    #endif // ONLINE_JUDGE
    nhap();
    cbi();
    xuli();
    ghikq();
    return 0;
}

#include <cstring>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <complex>
#include <list>
#include <climits>
#include <cctype>
#include <bitset>

using namespace std;

#define pb push_back
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) ((int)v.size())
#define rep(i, m) for (int i = 0; i < (int)(m); i++)
#define rep2(i, n, m) for (int i = n; i < (int)(m); i++)
#define For(it, c) for (__typeof(c.begin()) it = c.begin(); it != c.end(); ++it)
#define mem(a, b) memset(a, b, sizeof(a))
#define mp make_pair
#define dot(a, b) ((conj(a) * (b)).X)
#define X real()
#define Y imag()
#define length(V) (hypot((V).X, (V).Y))
#define vect(a, b) ((b) - (a))
#define cross(a, b) ((conj(a) * (b)).imag())
#define normalize(v) ((v) / length(v))
#define rotate(p, about, theta) ((p - about) * exp(point(0, theta)) + about)
#define pointEqu(a, b) (comp(a.X, b.X) == 0 && comp(a.Y, b.Y) == 0)

typedef stringstream ss;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vector<int> > vii;
typedef long double ld;
typedef complex<double> point;
typedef pair<point, point> segment;
typedef pair<double, point> circle;
typedef vector<point> polygon;

const int oo = (int) 1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;

int main() {
#ifdef AHMED_ALY
	freopen("a.txt", "rt", stdin);
	//freopen("b.txt", "wt", stdout);
#endif
	vi v(3);
	while (cin >> v[0] >> v[1] >> v[2]) {
		int ret = 0;
		sort(all(v));
		while (v[0]) {
			if (v[2] - v[0] < 2) {
				ret += v[0];
				break;
			}
			int d = (v[2] - v[1] + 1) / 2;
			ret += d;
			v[2] -= d * 2;
			v[1] -= d;
			sort(all(v));
		}
		ret += min(v[1], v[2] / 2);
		cout << ret << endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	long long int colour[3];
	cin >> colour[0] >> colour[1] >> colour[2];
	sort(colour,colour+3);
	long long int sum = colour[0];
	colour[1] -= colour[0];
	colour[2] -= colour[0];
	long long int x = colour[2] - colour[1];
	if(colour[2]-2*x >= 0 && colour[1]-x >= 0){
		sum += colour[2] - colour[1];
		colour[2] = colour[2] - 2 * (x);
		colour[1] = colour[1] - x;
	}
	sum += (colour[2] + colour[1]) / 3;
	cout << sum << endl;
	return 0;
}

#include<iostream>
#include<vector>
#include<math.h>
#include<stack>
#include<string>
#include<set>
#include<unordered_set>
#include<queue>
#include<iomanip>
#include<stack>
#include<algorithm>
#include<map>
#include<climits>
#define lld long long
#define mod 1000000009
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int solve(){
  vector<long int> a(3);
  long int ans=0;
  cin>>a[0]>>a[1]>>a[2];
  sort(a.begin(),a.end());
  ans+=a[0];
  a[1]=a[1]-a[0];
  a[2]=a[2]-a[0];
  long int p=min(a[2]/2,a[1]);
  if(p==a[1]){
    cout<<ans+p<<endl;
    return 0;
  }
  else{
    if(a[2]%2!=0)
      if(a[1]-(a[2]/2)>=2)
        p++;
    cout<<ans+p<<endl;
  }
}
int  main(){
  int t;
  // cin>>t;
  t=1;
  while(t--){
    solve();
  }
}

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	long long a[3];

	cin >> a[0] >> a[1] >> a[2];

	sort(a,a+3);

	long long result = a[0] + a[1] + a[2];

	result = min(result,a[1]+a[2]);

	cout << result << endl;

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define ss string
#define ll long long
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define inf 99999
#define pb push_back

ll a, b, c, ans, d, ma;

int main(){
    speed;
    cin >> a >> b >> c;
    ma = max(a, max(b, c));
    if(ma  >= (a + b + c - ma)){
        cout << a + b + c - ma;
        return 0;
    }
    d = min(a, min(b, c));
    a -= d;
    b -= d;
    c -= d;
    if(a + b + c >= 3){
        ans += (a + b + c) / 3;
    }
    cout << ans + d;
}

#include <bits/stdc++.h>

using namespace std;

long long cls[3];

long long dod(long long a, long long b){

    long long res = 0;
    res += a / 2;
    a = 1;
    b -= res;
    if(b >= 2){
        ++res;
    }
    return res;
}

int main()
{
    cin >> cls[0] >> cls[1] >> cls[2];

    if(cls[0] + cls[1] + cls[2] < 3 || ((cls[0] == 0 && cls[1] == 0) || (cls[0] == 0 && cls[2] == 0) || (cls[2] == 0 && cls[1] == 0))){
        cout << "0\n";
        return 0;
    }

    long long nt = 0;
    long long x = min(cls[0], min(cls[1], cls[2]));
    nt += x;

    cls[0] -= x;
    cls[1] -= x;
    cls[2] -= x;

    sort(cls, cls + 3);

    x = cls[2] - cls[1];
    nt += x;
    cls[1] -= x;
    cls[2] -= 2 * x;

    if(cls[2] == 0){
        cout << nt << "\n";
        return 0;
    }

    if(cls[2] % 2 == 0){
        nt += 2;
        cls[1] -= 3;
        cls[2] -= 3;
    }

    nt += dod(cls[1], cls[2]);

    cout << nt << "\n";
    return 0;
}

#include <iostream>
using namespace std;
long long int r,g,b,ans;
int main(){
cin>>r>>g>>b;
if(b>g) swap(b,g);
if(g>r)swap(g,r);
if(g>b) swap(g,b);
if(b+g> (r/2) ){
if(b&&g){
ans= r/2;
ans+= min(g, ((b+g-(r/2))/3) );
}
else
 ans= r/2;

if((r%2)&& (((b+g-(r/2))%3)==2)&& (b||g) )
    ans++;
cout<<ans<<endl;
}
else
cout<<b+g<<endl;
return 0;
}

#include <bits/stdc++.h>
#define pb push_back
#define lp(p,n) for(int p=0; p<n; p++)

using namespace std;

int f(int a,int b){
    if(a+b==3) return 1;
    if(a+b<3)return 0;

    return max(1+f(a-2,b-1), 1+f(a-1,b-2));

}

int main(){
	int  arr[3];
	scanf("%d%d%d", &arr[0],&arr[1],&arr[2]);
	sort(arr,arr+3);
    if(arr[0]+arr[1]<=arr[2]/2){
		cout<<arr[0]+arr[1];
	}
	else{
		cout<<((arr[0]+arr[1]+arr[2])/3);
    }

//	lp(i,n){
//		cin>>x;
//		mx=max((int)x,(int)mx);
//		count1[x]++;
//	}

}

#include <iostream>
using namespace std;
int first(int r,int g,int b){
    long long mn=100000000000,num=0;
    if(r<mn)mn=r;
    if(g<mn)mn=g;
    if(b<mn)mn=b;
    num=mn;
    r-=mn;
    g-=mn;
    b-=mn;
    int cntr;
    if(r==0&&g!=0&&b!=0){
        if(g>b){
            cntr=b;
            if(g<2*b){
                while(g!=2*cntr){cntr--;}
                num+=cntr;
            }
            else if(g>2*b){
                num+=b;
            }
        }
        else if(g<b){
            cntr=g;
            if(b<2*g){
                while(b!=2*cntr){cntr--;}
                num+=cntr;
            }
            else if(b>=2*g){
                num+=g;
            }
        }
        else{
            while(g>=0&&b>=0){
                while(g>=b){
                    g-=2;
                    b--;
                    if(g>=0&&b>=0)num++;
                }
                while(b>=g){
                    b-=2;
                    g--;
                    if(g>=0&&b>=0)num++;
                }
            }
        }
    }
    else if(r!=0&&g==0&&b!=0){
        if(r>b){
            cntr=b;
            if(r<2*b){
                while(r!=2*cntr){cntr--;}
                num+=cntr;
            }
            else if(r>=2*b){
                num+=b;
            }
        }
        else if(r<b){
            cntr=r;
            if(b<2*r){
                while(b!=2*cntr){cntr--;}
                num+=cntr;
            }
            else if(b>=2*r){
                num+=r;
            }
        }
        else{
            while(r>=0&&b>=0){
                while(r>=b){
                    r-=2;
                    b--;
                    if(r>=0&&b>=0)num++;
                }
                while(b>=r){
                    b-=2;
                    r--;
                    if(r>=0&&b>=0)num++;
                }
            }
        }
    }
    else if(r!=0&&g!=0&&b==0){
        if(r>g){
            cntr=g;
            if(r<2*g){
                while(r!=2*cntr){cntr--;}
                num+=cntr;
            }
            else if(r>=2*g){
                num+=g;
            }
        }
        else if(r<g){
            cntr=r;
            if(g<2*r){
                while(g!=2*cntr){cntr--;}
                num+=cntr;
            }
            else if(g>=2*r){
                num+=r;
            }
        }
        else{
            while(g>=0&&r>=0){
                while(g>=r){
                    g-=2;
                    r--;
                    if(g>=0&&r>=0)num++;
                }
                while(r>=g){
                    r-=2;
                    g--;
                    if(g>=0&&r>=0)num++;
                }
            }
        }
    }
    return num;
}
int second(int r,int g,int b){
    int t=0;
    long long min=1000000000000;
    if(r<min)min=r;
    if(g<min)min=g;
    if(b<min)min=b;
    t+=min;
    r-=min;
    g-=min;
    b-=min;
    if(r==0){
        while(g+b>=3){
            if(g>b){
                g-=2;
                b--;
                t++;
                if(g==0||b==0)break;
            }
            else{
                b-=2;
                g--;
                t++;
                if(g==0||b==0)break;
            }
        }
    }
    else if(g==0){
        while(r+b>=3){
            if(r>b){
                r-=2;
                b--;
                t++;
                if(r==0||b==0)break;
            }
            else{
                b-=2;
                r--;
                t++;
                if(r==0||b==0)break;
            }
        }
    }
    else{
        while(g+r>=3){
            if(g>r){
                g-=2;
                r--;
                t++;
                if(g==0||r==0)break;
            }
            else{
                r-=2;
                g--;
                t++;
                if(g==0||r==0)break;
            }
        }
    }
    return t;
}
int main(){
    int r,g,b;
    cin>>r>>g>>b;
    if(first(r,g,b)>=second(r,g,b))cout<<first(r,g,b);
    else cout<<second(r,g,b);
    return 0;
}

#include<bits/stdc++.h>

using namespace std;
int main()
{
    int r,g,b,maxNo;
    cin>>r>>g>>b;
    vector<int> v(3);
    v[0]=r;
    v[1]=g;
    v[2]=b;
    sort(v.begin(),v.end());
    maxNo=v[0]+min(v[1]-v[0],(v[2]-v[0])/2);
    cout<<maxNo;
    return 0;
}

#include <functional>
#include <algorithm>
#include <iostream>
//#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>

using namespace std;

//#pragma comment(linker,"/STACK:102400000,102400000")
#define MEM0(a) (memset((a),0,sizeof(a)))
#define LEN(a) (int)strlen((a))
#define sfd(a) scanf("%d",&(a))
#define sf64d(a) scanf("%I64d",&(a))
#define sflf(a) scanf("%lf",&(a))
#define sfc(a) scanf("%c",&(a))
#define sfs(a) scanf("%s",&(a))
#define sf2d(a,b) scanf("%d%d",&(a),&(b))
#define sf3d(a,b,c) scanf("%d%d%d",&(a),&(b),&(c))
#define sf2lf(a,b) scanf("%lf%lf",&(a),&(b))
#define sf3lf(a,b,c) scanf("%lf%lf%lf",&(a),&(b),&(c))
#define sf264d(a,b) scanf("%I64d%I64d",&(a),&(b))
#define sf364d(a,b,c) scanf("%I64d%I64d%I64d",&(a),&(b),&(c))
#define pfd(a) printf("%d\n",(a))
#define pfc(a) printf("%c",(a));
#define pf64d(a) printf("%I64d\n",(a))
#define pff(a) printf("%f\n",(a))
#define pflf(a) printf("%lf\n",(a))
#define pfs(a) printf("%s\n",(a))
#define pf2d(a,b) printf("%d %d\n",(a),(b))
#define pf2s(a,b) printf("%s %s\n",(a),(b));
#define pf2f(a,b) printf("%f %f\n",(a),(b))
#define pf264d(a,b) printf("%I64d %I64d\n",(a),(b))
#define pfn printf("\n")
#define pfblank printf(" ")
#define LL long long
#define INT_MAX 2147483647
#define NULL 0
const int MOD = 1000000007;
const int INF = 0x7fffffff;

const int dir4[4][2] = { { -1,0 },{ 1,0 },{ 0,-1 },{ 0,1 } };
const double eps = 1e-8; const double PI = acos(-1.0);

inline int sign(double x) { return (x>eps) - (x<-eps); }

template<class T> T gcd(T a, T b) { return b ? gcd(b, a%b) : a; }
template<class T> inline T Min(T a, T b) { return a<b ? a : b; }
template<class T> inline T Max(T a, T b) { return a>b ? a : b; }

int main(){
	int r, g, b;
	sf3d(r, g, b);
	pfd((r + b + g) / 3);
	return 0;
}

#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <iomanip>
#include <utility>
#include <set>
#include <ctime>
#include <cstring>

#define pb push_back
#define f first
#define s second
#define mp make_pair
#define y1 function_cmath
#define sz(c) (int)c.size()

typedef long long ll;

using namespace std;

int r, g, b;
int x, k, y;
int ans;
int tr, tg, tb;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    #ifndef ONLINE_JUDGE
    freopen ("input.txt", "r", stdin);
    freopen ("output.txt", "w", stdout);
    #endif

    cin >> r >> g >> b;

    x = min(min(r, g), b);

    ans += x;

    r -= x;
    g -= x;
    b -= x;

    if(r > 0)
        tr++;
    if(g > 0)
        tg++;
    if(b > 0)
        tb++;

    if(tr > 0 && tg > 0) {
        ans += max(r, g) / 2;
        r -= max(r, g) / 2;
        g -= max(r, g) / 2;
        int pp = min(r, g) - max(r, g) / 2;
        ans += pp / 2;
        r -= pp / 2;
        g -= pp / 2;
    }
    else if(tr > 0 && tb > 0) {
        ans += max(r, b) / 2;
        r -= max(r, b) / 2;
        b -= max(r, b) / 2;
        int pp = min(r, b) - max(r, b) / 2;
        ans += pp / 2;
        r -= pp / 2;
        b -= pp / 2;
    }
    else if(tg > 0 && tb > 0) {
        ans += max(g, b) / 2;
        g -= max(g, b) / 2;
        b -= max(g, b) / 2;
        int pp = min(g, b) - max(g, b) / 2;
        ans += pp / 2;
        g -= pp / 2;
        b -= pp / 2;
    }

    cout << ans;

    #ifndef ONLINE_JUDGE
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif

    return 0;
}

#include <iostream>
#include <algorithm>
#include <fstream>

using namespace std;

#define MAXI(A,B,C) (A>B?(A>C?A:C):(B>C?B:C))
#define MINI(A,B,C) (A<B?(A<C?A:C):(B<C?B:C))

typedef long long ll;

ll fun1(ll o)
{
	ll p=1;
	while(o>=1)
	{
		o/=10;
		p*=10;
	}
	return p;
}

int main()
{
	//ifstream f("file.txt");
	ll r, g, b;
	cin>>r>>g>>b;
	if(r==g && g==b)
	{
		cout<<r<<endl;
		return 0;
	}
	ll A[3]={r,g,b};
	sort(A,A+3);

	if(r==0 || g==0 || b==0)
	{
		if(r==0 && g==0)
		{
			cout<<0<<endl;
			return 0;
		}
		else if(r==0 && b==0)
		{
			cout<<0<<endl;
			return 0;
		}
	    else if(g==0 && b==0)
		{
			cout<<0<<endl;
			return 0;
		}

	}
	ll sum=r+g+b;
	ll kol=0;
	ll Max;
	ll Min;

	ll dgMi=A[0];
	ll  kolMi=fun1(A[0]);
	kolMi/=10;
	if(kolMi==0 )
	{
		kolMi=1;
	}
	if(kolMi==A[0] && A[0]!=1)
	{
		kolMi/=10;
	}

	bool b1=false;
	while(sum>=3)
	{
		sort(A,A+3);
		//cout<<A[0]<<" "<<A[1]<<" "<<A[2]<<endl;

		if(A[0]==A[1] && A[1]==A[2])
		{
			kol+=A[0];
			break;
		}
		if(b1==false)
		{
			if(A[0]<=0)
			{
				b1=true;
				kolMi=fun1(A[1]);
				continue;
			}
			else
			{
				if(A[0]<=kolMi && kolMi!=1)
				{
					kolMi/=10;
				}
				A[0]-=kolMi;
			}
			A[2]-=kolMi*2;
		}
		else
		{
			if(A[1]<=0)
			{
				break;
			}
			else
			{
				if(A[1]<=kolMi && kolMi!=1)
				{
					kolMi/=10;
				}
				else if(A[1]==A[2] && kolMi*2==A[2])
				{

					kolMi/=10;
				//	cout<<kol<<endl;
					//cout<<kolMi<<endl;
				//	system("pause");
				}
				if(A[1]==2 && A[2]==2)
				{
					kol++;
					break;
				}
				A[1]-=kolMi;
			}
			A[2]-=kolMi*2;
		}
		sum-=kolMi*3;
		kol+=kolMi;
		//cout<<kol<<endl;
		//cout<<kolMi<<endl;
	}
	cout<<kol<<endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int cmp(int a,int b,int c)
{
    if(a >= b && a >= c)
    {
        if(b>=c)return b;
        return c;
    }
    else if(b >= a && b >= c)
    {
        if(a>=c)return a;
        return c;
    }
    else
    {
        if(a>=b)return a;
        else return b;
    }
}
int main()
{

        int a,b,c,d=0,x,y;
        cin >> a >> b >> c;
        int e,f,g;
        e = a;
        f = b;
        g = c;
        a = max(e,max(f,g));
        b = cmp(e,f,g);
        c = min(e,min(f,g));
        while(a>=1 && b >= 1 && c >=1)
        {
            if( a > b && b >= c)
            {
                x = (a-b)/2;
                if( (a-b)%2 != 0 )x++;
                if( c - (x/2) >= 0)
                {
                    a -= x;
                    c -= (x/2);
                    d+=x;
                }
                else
                {
                    d += c;
                    a -= (2*c);
                    c = 0;
                }

            }
            else if(a == b && b > c)
            {
                y = c/2;
                x = c-y;
                a -= (2*y);
                b -= (2*x);
                d += c;
                c = 0;
            }
            else if(a ==b && b == c)
            {
                d += a;
                a = 0;
                b = 0;
                c= 0;

                break;
            }
            e = a;
            f = b;
            g = c;
            a = max(e,max(f,g));
            b = cmp(e,f,g);
            c = min(e,min(f,g));
        }
        if(a >= (2*b))d+=b;
        else d += ((a+b)/3);
        cout << d << endl;

    return 0;
}

//#include <iostream>
//#include <algorithm>
//#include <cstdio>
//using namespace std;
//int w[100005];
//int main()
//{
//	int n,k;
//	cin>>n>>k;
//	int ans=0;
//	for(int i=0;i<n;i++)
//	{
//		cin>>w[i];
//		if(w[i]%k!=0)
//		w[i]=w[i]/k+1;
//		else w[i]=w[i]/k;
//		ans+=w[i];
//	}
//	if(ans%2==0)
//	cout<<ans/2<<endl;
//	else cout<<ans/2+1<<endl;
//}
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long long int s[3];
	while(cin>>s[0]>>s[1]>>s[2])
	{
		sort(s,s+3);
		long long int ans=0;
		ans+=s[0];
		s[1]-=s[0];
		s[2]-=s[0];
		if(s[2]>=(s[1]*2))
		ans+=s[1];
		else
		ans+=(s[1]+s[2])/3;
		cout<<ans<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>
#include <algorithm>
typedef long long int ll;
typedef long l;
typedef double d;
using namespace std;
int minima(int a , int b){
    int maxi = ( a < b ) ? a : b;
    return maxi;
}

int main() {
    ll a,b,c;
    cin >> a >> b >> c;

    ll x = (a + b + c) / 3;
    x = minima(x,a+b);
    x = minima(x,b+c);
    x = minima(x,c+a);
    cout << x << endl;
}

#include <bits/stdc++.h>

using namespace std;
#define MK              make_pair
#define PB              push_back
#define ALL(v)          (v).begin() , (v).end()
#define Set(v,x)        memset(  v , x , sizeof(v))
#define two(n)          ( 1 << (n) )
#define contain(Set,i)  ( (Set) & two(i) )
#define __join(a,b)     a##b
#define foreach(c, i)   for(__typeof((c).begin())i=(c).begin(),__join(i,__end)=(c).end();i!=__join(i,__end);i++)

#define FOR(i,n)        for (int i = 0 ; i < (n) ; i++)
#define REP(i, b, e) 	  for(typeof(e) i=b; i!=e; ++i)
#define INF             1000000
#define EPS             1e-6
#define MAX             100000

#define MAXE            1000000
#define COST            first
#define V1              second.first
#define V2              second.second

typedef vector<int> VI;
typedef long long int ll;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
typedef vector<PII> VII;
typedef pair<pair<int,int>,int> PIII;

int main() {
 // freopen("in.txt","r", stdin);
  // freopen("out.txt","w", stdout);

  int r, g, b;
  cin >> r >> g >> b;
  VL a = {r,g,b};
  sort(ALL(a));
  ll res = a[0];
  a[1] -= a[0];
  a[2] -= a[0];
  if (a[1] == 0 || a[2] == 0) {
    cout << res << endl;
    return 0;
  }
  if (a[1] == 1 && a[2] == 1) {
    cout << res << endl;
    return 0;
  }
  res += a[2]-a[1];
  a[2] -= a[2]-a[1];
  a[1] -= a[2]-a[1];
  if (a[1]%3 == 0 || a[1]%3==1) res += a[1]/3*2;
  else res += a[1]/3*2+1;
  cout << res << endl;

  return 0;
}

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;

#define fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define ll long long
#define ull unsigned long long
#define ld long double
#define endl "\n"
#define ff first
#define ss second
#define pi pair<ll, ll>
#define PI 3.141592653589793238462643383279502884L
#define mp make_pair
#define pb push_back
#define fall(i, a, b) for (int i = a; i < b; i++)
#define sz(x) (ll) x.size()
#define all(x) x.begin(), x.end()
#define ed cout << "ed";
#define time_passed 1.0 * clock() / CLOCKS_PER_SEC
ll MOD = 1e9 + 7;
ll MOD1 = 1e9 + 123;
ll MOD2 = 1e9 + 321;
ll MOD3 = 998244353;
vector<int> G[1000000];
vector<int> L(1000000, -1);
void dfs(ll y, ll c = 0)
{
    L[y] = c;
    // cout<<y<<" ";
    for (auto h : G[y])
    {
        if (L[h] < 1 + c)
            dfs(h, 1 + c);
    }
}

int main()
{
    fio;
    ll t, a, n, q, k, i, r, g, l, m, c, u, f, j, p, x, y, b, d;
    int A[3];
    cin >> A[0] >> A[1] >> A[2];
    sort(A, A + 3);
    c = 0;
    c += A[0];
    A[1] -= A[0];
    A[2] -= A[0];
    if (A[2] >= 2 * A[1])
        c += A[1];
    else
        c += (A[2]+1) / 2;
    cout << c << endl;

    cerr << "\n\n\n\n"
         << time_passed << endl;
    return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	long long a, b, c, count = 0;
	bool flag = 1;
	cin >> a >> b >> c;
	vector<long long> rez = { a,b,c };
	sort(rez.begin(), rez.end());
	while (rez[0] != 0 || rez[1] != 0)
	{
		if (!flag)
		{
			break;
		}
		if (rez[0] != 0 && rez[1] != 0)
		{
			rez[0]--;
			rez[1]--;
			rez[2]--;
			count++;
			continue;
		}
		if (rez[0] == 0 && rez[1] != 0 && rez[2] - 2 >= 0)
		{
			rez[1]--;
			rez[2] -= 2;
			count++;
			continue;
		}
		flag = 0;
	}
	cout << count;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
//#define N 8
int main()
{
    ll m,n,p,mi,res;
    cin>>m>>n>>p;
    mi=min(m,n);
    mi=min(mi,p);
    m=m-mi;
    n=n-mi;
    p=p-mi;
    res=mi;
    if(p==0)
    {
        res=res+(2*min(m/3,n/3));
        m=m%3;
        n=n%3;
        if(n+m>=3)
        {
            res=res+1;
        }
    }
    else if(n==0)
    {
        res=res+(2*min(m/3,p/3));
        m=m%3;
        p=p%3;
        if(p+m>=3)
        {
            res=res+1;
        }
    }
    else
    {
        res=res+(2*min(p/3,n/3));
        p=p%3;
        n=n%3;
        if(n+p>=3)
        {
            res=res+1;
        }
    }
    cout<<res<<"\n";
}

#include<stdio.h>
using namespace std;

long long r,g,b,ac,res;

int main(){
	scanf("%d%d%d",&r,&g,&b);
	res+=(r/3);
	r=r%3;
	res+=(g/3);
	g=g%3;
	res+=(b/3);
	b=b%3;
	ac=r+g+b;
	res+=(ac/3);
	printf("%I64d\n",res);
}

#include<bits/stdc++.h>

using namespace std;

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(i=0;i<n;i++)
#define pr pair<int,int>
#define pll pair<long long,long long>
#define ll long long
#define v vector
#define all(a) a.begin(),a.end()
#define ina(a,i,n) for(i=0;i<n;i++)cin>>a[i]
#define mmst(a) memset(a,0,sizeof(a));
#define max3(a,b,c) max(a,max(b,c));
#define min3(a,b,c) min(a,min(b,c));

int main() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);
    ll i,j,k,n,m,x,y,l,t;
    int a[3];
    ina(a,i,3);
    sort(a,a+3);
    int ans = a[0];
    a[1] -= a[0];
    a[2] -= a[0];
    ans += min(a[2]/2,a[1]);
    if(a[2]%2 && a[2]/2+1<a[1]) {
        ans++;
    }
    cout<<ans;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

bool cmp(int a,int b)
{
	if(a>b)
	return 1;
	return 0;
}

int main()
{
	int arr[3],c=0;

	cin>>arr[0]>>arr[1]>>arr[2];

	sort(arr,arr+3,cmp);

	//cout<<arr[0]<<arr[1]<<arr[2];

	while(1)
	{//cout<<arr[0]<<" "<<arr[1]<<" "<<arr[2]<<endl;
		if((arr[0]>0&&arr[1]>0&&arr[2]>0))
		{
			arr[0]--;
			arr[1]--;
			arr[2]--;
			c++;
		}
		else if(arr[0]>1&&arr[1]>0)
		{
			arr[0]-=2;
			arr[1]--;
			c++;
		}
		else
		break;
	}

	cout<<c<<endl;
	return 0;
}

#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cctype>
#define int long long
using namespace std;
int a[5];
inline int read()
{
	int x=0;char ch=getchar();
	while(!isdigit(ch)) ch=getchar();
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x;
}
signed main()
{
	a[1]=read(),a[2]=read(),a[3]=read();
	sort(a+1,a+4);
	printf("%lld\n",a[1]+min(a[2]-a[1],(a[3]-a[1])/2));
	return 0;
}

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    unsigned long long r(0),g(0),b(0);
    cin >> r >> g >> b;
    unsigned long long buf;
    if(r<g){buf = r ; r = g; g = buf;}
    if(g<b){buf = g ; g = b; b = buf;}
    if(r<g){buf = r ; r = g; g = buf;}
    unsigned long long res(0);
    unsigned long long div(0);
    div = (g / 3)?g/3:1;
    while(r*g + g*b + b*r > 9 * div *div || div == 1 ){
        if(r - b >= div){
            r -= 2 * div;
            g -= div;
            res += div;
        }else{
            r -= div;
            g -= div;
            b -= div;
            res += div;
        }
        if(r<g){buf = r ; r = g; g = buf;}
        if(g<b){buf = g ; g = b; b = buf;}
        if(r<g){buf = r ; r = g; g = buf;}
        div = (g / 3)?g/3:1;
    };
    /*
     while(r*g + g*b + b*r > 1){
        if(r - b >= 1){
            r-=2 * 1;
            g-= 1;
            res += 1;
        }else{
            r-= 1;
            g-= 1;
            b-= 1;
            res += 1;
        }
        if(r<g){buf = r ; r = g; g = buf;}
        if(g<b){buf = g ; g = b; b = buf;}
        if(r<g){buf = r ; r = g; g = buf;}
    };
    */
    cout << res << endl;
    return 0;
}

/*
1 2000000000 1000000000
*/

#include <bits/stdc++.h>
using namespace std;

template <class T> int size(const T &x) {return x.size();}
template <class T> T mod(T a, T b) { return (b + (a % b)) % b;}

#define F first
#define S second
#define PB push_back
#define endl '\n'
#define rep(i, a, b) for(__typeof(a) i=a; i<(b); i++)
#define iter(it, c) for(__typeof((c).begin()) it=(c).begin(); \
 it != (c).end(); it++)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef set<int> si;

const int INF = ~(1 << 31);
const double EPS = 1e-9;
const double PI = acos(-1);

int main() {
    int d[3];
    rep(i, 0, 3) cin >> d[i];
    sort(d, d + 3);

    int cont = d[0];
    d[1] -= d[0]; d[2] -= d[0];
    while(d[1] + d[2] >= 3 && d[1] > 0 && d[2] > 0) {
        if(d[1] >= d[2])
            d[1] -= 2, d[2] -= 1;
        else
            d[1] -= 1, d[2] -= 2;
        cont++;
    }
    cout << cont << endl;
    return 0;
}

#pragma region include

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<sstream>
#include<queue>
#include<math.h>
#include<stdlib.h>
#include<stack>
#include<string.h>
#include<string>
#include<map>
#include<algorithm>
#include<time.h>
#include<set>
#include<vector>
#include<numeric>
#include<iomanip>
#include <bitset>
#include <functional>
using namespace std;

#pragma endregion

#pragma region define
#define All(a) a.begin(), a.end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define rep(i,n) for(int i=0;i<int(n);i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define repi(i,a,n) for(int i=int(a);i<int(n);i++)
#define clr(a, n) memset(a, n, sizeof(a));
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define MP make_pair
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.14
#define INF 2000000000 // 2 billion
#define read freopen("in.in","r",stdin)
#define write freopen("out.out","w",stdout)
#pragma endregion

#pragma region typedef

typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, string> is;
typedef pair<int, int> ii;

#pragma endregion
int main(){

	ll a[3];
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	ll r = a[0];
	a[1] -= a[0];
	a[2] -= a[0];
	int x = a[2] / 2;
	if (x >= a[1]) r += a[1], a[1] =0;
	else{
		r += x, a[1] -= x;
		a[2] -= (x * 2);
		if (a[1]>=2 && a[2]) r++;
	}
	cout << r;

	return 0;
}

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define l(i,a,b) for(auto i=a;i<b;i++)
#define lr(i,a,b) for(auto i=a;i>=b;i--)
#define ll long long
#define lli long long int
#define ld long double
#define vec vector<int>
#define mii map<int,int>
#define vl vector<long long>
#define se set <long long int>
#define pi pair<int,int>
#define pb push_back
#define mp make_pair
#define ft first
#define sd second
#define all(v) v.begin(), v.end()
#define in(x) cin>>x
#define o(x) cout<<x
#define SYNC ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main()
{
    lli r,g,b,min,count=0,sec,max;
    in(r)>>g>>b;
    min=(r<g)?r:g;
    max=(r>g)?r:g;
    min=(b<min)?b:min;
    max=(b>max)?b:max;
    sec=r+g+b-max-min;
    count+=min;
    max-=min;
    sec-=min;
    count+=(max/2<sec)?max/2:sec;
    o(count);
}

#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    int r,g,b;
    scanf("%d %d %d",&r,&g,&b);
    printf("%d\n",min(min(min((r+g+b)/3,r+g),r+b),b+g));
}
/*2018-08-24 10:52:20.578*/

#include <cstdint>
#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

uint32_t main()
{
	vector< uint64_t > rgb( 3 );
	cin >> rgb[0] >> rgb[1] >> rgb[2];

	uint64_t t = 0;
	while( rgb[0] && rgb[1] && rgb[2] ||
		( rgb[0] && rgb[1] && rgb[0] + rgb[1] >= 3 ) ||
		( rgb[0] && rgb[2] && rgb[0] + rgb[2] >= 3 ) ||
		( rgb[1] && rgb[2] && rgb[1] + rgb[2] >= 3 ) )
	{
		if( rgb[0] == rgb[1] && rgb[1] == rgb[2] )
		{
			t += rgb[0];
			rgb[0] = 0;
			rgb[1] = 0;
			rgb[2] = 0;
			break;
		}

		sort( rgb.begin(), rgb.end(), []( uint64_t v1, uint64_t v2 ){ return v1 > v2; } );

		if( rgb[0] == rgb[1] )
		{
			uint64_t d = ( rgb[0] - rgb[2] ) / 3;
			if( d )
			{
				t += 2 * d;
				rgb[0] -= 3 * d;
				rgb[1] -= 3 * d;
				continue;
			}
			else if( rgb[2] )
			{
				d = rgb[2];
				t += d;
				rgb[0] -= d;
				rgb[1] -= d;
				rgb[2] -= d;
				continue;
			}
		}
		else if( rgb[1] == rgb[2] )
		{
			uint64_t d = min( ( rgb[0] - rgb[1] ) / 4, rgb[1] );
			if( d )
			{
				t += 2 * d;
				rgb[0] -= 4 * d;
				rgb[1] -= d;
				rgb[2] -= d;
				continue;
			}
			else if( rgb[1] )
			{
				d = rgb[1];
				t += d;
				rgb[0] -= d;
				rgb[1] -= d;
				rgb[2] -= d;
				continue;
			}
		}

		uint64_t d1 = ( rgb[0] - rgb[1] ) / 2;
		uint64_t d2 = rgb[1] - rgb[2];
		if( d1 && d2 )
		{
			if( d1 < d2 )
			{
				t += d1;
				rgb[0] -= 2 *d1;
				rgb[1] -= d1;
			}
			else
			{
				t += d2;
				rgb[0] -= 2 * d2;
				rgb[1] -= d2;
			}
		}
		else
		{
			t++;
			rgb[0] -= 2;
			rgb[1]--;
		}
	}

	cout << t;

	return EXIT_SUCCESS;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#define N 100
#define LL long long
#define oo (1<<30)
using namespace std;
int len=0,ans=0,cur=0,V[N][N][N];
int a[N],f[2][N][N][N],x[N][N];
void dfs(int t,int a,int b,int c)
{
	if(t>3){
		if(V[a][b][c]) return ;
		V[a][b][c]=1;
		x[++len][0]=a;
		x[len][1]=b;
		x[len][2]=c;
		return ;
	  }
	dfs(t+1,a+1,b,c);
	dfs(t+1,a,b+1,c);
	dfs(t+1,a,b,c+1);
}
int main()
{
	int i,j,k,l;
	for(i=0;i<3;i++){
		LL x; cin>>x;
		a[i]=(int)(min(x,35LL));
	  }
	dfs(1,0,0,0);
	for(i=0;i<N;i++)
		for(j=0;j<N;j++)
			for(k=0;k<N;k++)
				f[0][i][j][k]=-oo;
	f[0][a[0]][a[1]][a[2]]=0;
	for(i=1;i<=len;i++){
		cur^=1;
		for(j=0;j<N;j++)
			for(k=0;k<N;k++)
				for(l=0;l<N;l++)
					f[cur][j][k][l]=-oo;
		for(j=0;j<40;j++)
			for(k=0;k<40;k++)
				for(l=0;l<40;l++){
					f[cur][j][k][l]=f[cur^1][j][k][l];
					f[cur][j][k][l]=max(f[cur][j][k][l],f[cur^1][j+x[i][0]][k+x[i][1]][l+x[i][2]]+1);
					ans=max(ans,f[cur][j][k][l]);
				  }
	  }
	printf("%d",ans);
	return 0;
}

#include<bits/stdc++.h>
#define up(j,k,i) for(i=j;i<k;i++)
#define down(j,k,i) for(i=j;i>k;i--)
#define M 1000000007
#define pp(n) printf("%lld\n",ll(n))
#define ps(n) printf("%lld ",ll(n))
#define pd(x,y) printf("%lld %lld\n",ll(x),ll(y))
#define is(n) scanf("%lld",&n)
#define max(x,y) max(ll(x),ll(y))
#define min(x,y) min(ll(x),ll(y))
#define inf LLONG_MAX
#define id(n,m) scanf("%lld%lld",&n,&m)
#define it(n,m,k) scanf("%lld%lld%lld",&n,&m,&k)
#define ss(s) scanf("%s",s)
#define cool 0
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pll pair<ll,ll>
#define db cout<<"######\n"
#define null(a) memset(a,0,sizeof(a))
#define neg(a) memset(a,255,sizeof(a))
typedef long double ld;
typedef long long int ll;
using namespace std;
ll i,j,k,z,t,n,m,sum,ans,x,y,maxm=0,minm=inf;
inline ll ceil(ll x,ll y)
{
if(x%y) return x/y+1;
else return x/y;
}
int main()
{
ll a[3];
up(0,3,i)
is(a[i]);
sort(a,a+n);
x=max(0,ceil(2*a[2]+2*a[1]-a[0],3));
a[2]-=x;
a[1]-=x;
a[0]-=x;
ans+=x;
x=min(a[0]/2,a[1]);
a[0]-=2*x,a[1]-=x;
ans+=x;
x=min(a[0]/2,a[2]);
a[0]-=2*x,a[2]-=x;
ans+=x;
pp(ans);
}

#include <bits/stdc++.h>
using namespace std;

int main() {

    long long r,b,g,addi;
    cin>>r>>b>>g;
    long long ans=min(r,min(b,g));
    r-=ans;
    b-=ans;
    g-=ans;
    int a[3];
    a[0]=r;
    a[1]=b;
    a[2]=g;
    sort(a,a+3);
    if(a[0]==0 && a[1]==0)
    {
        cout<<ans;
        return 0;
    }
    else if(a[0]==0 && a[2]>=2*a[1])
    {
        ans+=a[1];
        cout<<ans;
        return 0;
    }
    else
    {
    long long low=0,high=a[1];
    while(low<high)
    {
        long long mid=(low+high)/2;
        if(mid==0)
        break;
        if(2*mid<=high)
        {
        //addi=mid;
        low=mid;
        }
        else
        {
            high=mid-1;
        }
    }

    a[1]-=low;
    a[2]-=(2*low);

    if(a[1]!=0)
    {
        if(a[2]>=2)
        ans++;
    }
         ans+=low;
         cout<<ans;
    }

    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
long a[3];

void sort() {
    for (int i = 0; i<3; i++)
        for (int j = 1; j<3; j++)
            if (a[j]>a[j-1])
                swap(a[j], a[j-1]);
}
void main() {
    for (int i = 0; i<3; i++)
        cin>>a[i];
    long sum = 0;
    sort();
    if ((a[0] + a[1] + a[2])>=3)
    if (a[0]<=(a[1]+a[2])*2)
        sum = (a[1]+a[2]+a[0])/3;
    else
        sum = a[1]+a[2];
    cout<<sum;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int r=0,g=0,b=0;
  cin>>r>>g>>b;
  long long int arr[3]={0};
  arr[0]=r;arr[1]=g;arr[2]=b;
  sort(arr,arr+3);
  long long int ans=0;
  ans+=arr[0];
  arr[1]=arr[1]-arr[0];
  arr[2]=arr[2]-arr[0];
  long long pop=0;
  if(arr[1]>0&&arr[2]>0)
  {
  pop=(arr[1]+arr[2])/3;
  }
  cout<<ans+pop;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define ld long double

#define mod 1000000007

int32_t main()
{
    ios::sync_with_stdio(0), cin.tie(0);

    ll t = 1;

    while(t--)
    {
        ll a, b, c;
        cin >> a >> b >> c;

        cout<<(a+b+c)/3;
    }
    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;

typedef long long LL;

int main( )
{
    LL a[3];
    LL b , res;
    cin >> a[0] >> a[1] >> a[2];
    sort( a , a+3 );
    res = 0;
    res += a[0];
    a[1] -= a[0];
    a[2] -= a[0];
    b = a[1] / 3;
    res += b;
    a[1] -= 3*b;
    a[2] -= 3*b;
    if( a[1] == 1 && a[2] >= 2 )
        res += 1;
    else if ( a[2] == 2 && a[2] >=4 )
        res += 2;
    cout << res << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
    // your code goes here
    long long c[3];
    cin >> c[0] >> c[1] >> c[2];
    long long ans=0;

    sort(c,c+3,greater<int>());

    if(c[1]-c[2]<(c[0]-c[2])/2)
        ans += c[1];
    else
        ans += c[2]+(c[0]-c[2])/2;
    cout << ans;
    return 0;
}

#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <sstream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <stdio.h>
#include <assert.h>
typedef long long ll;
#define mset(a, val) memset(a, val, sizeof(a))
#define up(i, s, t) for (ll i = (s); i < (t); i += 1)
#define down(i, s, t) for (ll i = (s); i > (t); i -= 1)
#define rd1(a) scanf("%d", &a)
#define rd2(a, b) scanf("%d %d", &a, &b)
#define rd3(a, b, c) scanf("%d %d %d", &a, &b, &c)
#define rd4(a, b, c, d) scanf("%d %d %d %d", &a, &b, &c, &d)
#define pii pair<int, int>

using namespace std;
const int MAXINT = 0x70707070;
const ll MAXLONG = (ll) 1 << 60;

int main () {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll arr[3];
	while (cin >> arr[0] >> arr[1] >> arr[2]) {
		sort(arr, arr + 3);

		ll res;
		if ( (arr[0] + arr[1]) * 2 <= arr[3] ) {
			res = arr[0] + arr[1];
		} else {
			res = (arr[0] + arr[1] + arr[2]) / 3;
		}

		cout << res << endl;
	}
	return 0;
}

//Amey Patel
#include<bits/stdc++.h>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test(t) int t;cin>>t;while(t--)typedef int MyCustomType;
#define arr(a,n) int a[n];for(int i=0;i<n;i++)cin>>a[i];
#define bs int binarySearch(int low,int high,int key){while(low<=high){int mid=(low+high)/2;if(a[mid]<key) low=mid+1;else if(a[mid]>key) high=mid-1;else return mid;}return -1;}
#define N 100005
#define endl '\n'
#define trace1(x)                cout<<x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define loop for(int i=0;i<n;i++)
#define int long long int
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int count[1000005];
	// int a[N];
	int a,b,c;
int32_t  main()
{
	sync;
	int f[3];
	rep(i,3)cin>>f[i];
	sort(f,f+3);
 	a=f[0];
 	b=f[1];
 	c=f[2];
 	int ans=a;
 	b-=a;
 	c-=a;
 	while(b<=c && b && c)
 	{
 		if(2*b<=c)
 			{
 				ans+=2*b;
 				break;
 			}
 		else if(b==c)
 			{
 				ans+=(b+c)/3;
 				break;
 			}
 		else
 			{
 				c-=c/2*2;
 				b-=c/2;
 				swap(b,c);
 				// break;
 			}
 }
 	cout<<ans<<endl;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
typedef vector <ll> vi;
typedef pair <ll,ll> ii;
typedef vector <pair <int,int> >vii;
int main()
{
    vi a;
    for(ll i=0;i<3;i++)
    {
        ll x;
        cin>>x;
        a.pb(x);
    }
    sort(a.rbegin(),a.rend());
    if(a[0]-a[2]<=1)
    {
        cout<<a[2]<<endl;
        return 0;
    }
    ll ans=0;
    while(a[0]-a[2]>1)
    {
        if(a[1]==0)
            break;
        ll a1=(a[0]-a[2])/2;
        ll a2=(a[1]-a[2]);
        a1=min(a1,a2);
        if(a1==0)
            break;
        ans+=a1;
        a[0]-=2*a1;
        a[1]-=a1;
        sort(a.rbegin(),a.rend());
    }
    ans+=a[2];
    cout<<ans<<endl;
}

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[])
{
	long long r,g,b;
	cin >> r >> g >> b;
	long long tmp=min(r,min(g,b));
	long long ans=0;
	ans+=tmp;
	r-=tmp;
	g-=tmp;
	b-=tmp;
	if (r==0)
	{
		//cout << "herre\n";
		long long tt,tt1;
		long long ans1=0,ans2=0;
		long long tmpb=b,tmpg=g;

		//
		tt=min(tmpg/2,tmpb);
		tmpb-=tt;tmpg-=2*tt;
		ans1+=tt;
		tt=min(tmpb/2,tmpg);
		ans1+=tt;
		tmpb-=2*tt;tmpg-=tt;
		tt=tmpg+tmpb;
		ans1+=min(tt/3,tmp);
		//cout << "ans1 :" << ans1 << "\n";
		//
		tmpb=b;tmpg=g;
		//cout << "tmpb " << tmpb << " " << tmpg << "\n";
		tt1=min(tmpb/2,tmpg);
		tmpb-=2*tt1;tmpg-=tt1;
		ans2+=tt1;
		tt1=min(tmpg/2,tmpb);
		ans2+=tt1;
		tmpb-=tt1;tmpg-=2*tt1;
		tt1=tmpg+tmpb;
		ans2+=min(tt1/3,tmp);
		ans+=max(ans1,ans2);
		//cout << "ans2 : " << ans2 << "\n";
	}else if (g==0)
	{
		long long tt,tt1;
		long long ans1=0,ans2=0;
		long long tmpb=b,tmpg=r;

		//
		tt=min(tmpg/2,tmpb);
		tmpb-=tt;tmpg-=2*tt;
		ans1+=tt;
		tt=min(tmpb/2,tmpg);
		ans1+=tt;
		tmpb-=2*tt;tmpg-=tt;
		tt=tmpg+tmpb;
		ans1+=min(tt/3,tmp);
		//
		tmpb=b;tmpg=r;
		tt1=min(tmpb/2,tmpg);
		tmpb-=2*tt1;tmpg-=tt1;
		ans2+=tt1;
		tt1=min(tmpg/2,tmpb);
		ans2+=tt1;
		tmpb-=tt1;tmpg-=2*tt1;
		tt1=tmpg+tmpb;
		ans2+=min(tt1/3,tmp);
		ans+=max(ans1,ans2);
	}else{
		long long tt,tt1;
		long long ans1=0,ans2=0;
		long long tmpb=r,tmpg=g;

		//
		tt=min(tmpg/2,tmpb);
		tmpb-=tt;tmpg-=2*tt;
		ans1+=tt;
		tt=min(tmpb/2,tmpg);
		ans1+=tt;
		tmpb-=2*tt;tmpg-=tt;
		tt=tmpg+tmpb;
		ans1+=min(tt/3,tmp);
		//
		tmpb=r;tmpg=g;
		tt1=min(tmpb/2,tmpg);
		tmpb-=2*tt1;tmpg-=tt1;
		ans2+=tt1;
		tt1=min(tmpg/2,tmpb);
		ans2+=tt1;
		tmpb-=tt1;tmpg-=2*tt1;
		tt1=tmpg+tmpb;
		ans2+=min(tt1/3,tmp);
		ans+=max(ans1,ans2);
	}
	cout << ans << "\n";

	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <map>
#include <assert.h>
#include <set>
#define SI(i) scanf("%d", &i)
#define SII(i,j) scanf("%d%d", &i, &j)
#define SIII(i,j,k) scanf("%d%d%d", &i, &j, &k)
#define SS(i) scanf("%s\n", i)
#define SSS(i,j) scanf("%s %s", i, j)
#define SC(i) scanf("%c", &i)
#define SCC(i,j) scanf("%c %c\n", &i, &j)

#define PI(i) printf("%d ", i)
#define PII(i,j) printf("%d %d ", i, j)
#define PS(i) printf("%s", i)
#define PSS(i,j) printf("%s %s ", i, j)
#define PC(i) printf("%c", i)
#define PCC(i,j) printf("%c %c ", i, j)
#define PN printf("\n")
#define forin(i, k, n) for(int i = (k); i < (n); ++i)
#define rforin(i, k, n) for(int i = (k); i > (n); --i)
#define my_mod 1000000007
using namespace std;
long long r[3], ans, diff;
int main()
{
#ifdef _DEBUG
	freopen("1.in", "rt", stdin);
	freopen("1.out", "wt", stdout);
#endif
	SIII(r[0], r[1], r[2]);
	sort(r, r + 3);
	if (r[0] + r[1] <= r[2]/2)
	{
		PI(r[0] + r[1]);
		return 0;
	}
	ans = r[2] / 2;
	if (r[2] % 2)
	{
		++r[0];
		if (r[0] > r[1])
			swap(r[0], r[1]);
	}
	diff = min(r[1] - r[0], ans);
	r[1] -= diff;
	int rest = r[0] + r[1] - ans + diff;
	if (rest / 3 <= r[0])
	{
		PI(ans + rest / 3);
		return 0;
	}
	while (r[0] > 1 || r[1] > 1)
	{
		if (r[0] > r[1])
			swap(r[0], r[1]);
		if (r[0] == 0)
			break;
		r[1]-=2;
		--r[0];
		++ans;
	}
	PI(ans);
	return 0;
}

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int a[4];
int main()
{
	int sum=0;
	scanf("%d %d %d",&a[1],&a[2],&a[3]);
	sort(a+1,a+4);
	sum+=a[1];
	sum+=min((a[3]-a[1])/2,a[2]-a[1]);
	printf("%d",sum);
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int ans = 0;
    vector<int> color;
    for (int i = 0; i < 3; ++i) {
        int x;
        cin >> x;
        if (x) color.push_back(x);
    }
    sort(color.rbegin(), color.rend());
    while (color.size() == 3 || (color.size() == 2)) {
        if (color.size() == 3 && color[0] == 1 && color[1] == 1 && color[2] == 1) {
            ++ans;
            break;
        }
        if (color.size() == 2 && (color[0] == 1 && color[1] == 1)) break;
        int n = 0;
        if (color.front() >= 2*color.back()) {
            n = color.back();
            ans += n;
            color.front() -= 2 * n;
            color.back() -= n;
        } else {
            n = color.back();
            for (int i = 0; i < color.size(); ++i)
                color[i] -= n;
            ans += n;
        }
        if (n == 0) break;
        sort(color.rbegin(), color.rend());
        while (color.size() && color.back() == 0) color.pop_back();
    }
    cout << ans << '\n';
    return 0;
}

#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

struct Counter
{
	static int k;
	Counter() {k++;}
	~Counter() {k--;}
};

int Counter::k = 0;

template<typename T>
void pr(const string& name, T t)
{
    cout << name << " = " << t << endl;
}

template<typename T, typename ... Types>
void pr(const string& names, T t, Types ... rest)
{
    auto comma_pos = names.find(',');
    cout << names.substr(0, comma_pos) << " = " << t << ", ";

    auto next_name_pos = names.find_first_not_of(" \t\n", comma_pos + 1);
    pr(string(names, next_name_pos), rest ...);
}

#define all(x) x.begin(), x.end()
#define f(i,a,b) for(int i = (a); i <= (b); i++)
#define fd(i,a,b) for(int i = (a); i >= (b); i--)
#define mp make_pair
#define faster_io() ios_base::sync_with_stdio(false)
#define pb push_back
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define trace(...) pr(#__VA_ARGS__, __VA_ARGS__);
#define tracea(x) {string s = #x; Counter c##x; cout<<s.substr(0,1+s.find('['))<<Counter::k<<"]="<<x<<'\n';}
#define vii vector<pair<int,int>>

const ll MOD = 1000000007;

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

ll A[3];

int main()
{
    f(i,0,2) cin >> A[i];
    sort(A,A+3,greater<ll>());
    ll t = A[2];
    A[0] -= A[2];
    A[1] -= A[2];
    A[2] = 0;
    ll equal = A[0] - A[1];
    ll can = min(A[0]/2, A[1]);
    t += can;
    if(can >= equal)
    {
        A[0] = A[0] - 2*can;
        t += A[0] / 3;
        if(A[0]%3 == 2) t++;
    }
    cout << t;
}

#include <iostream>
using namespace std;
#include<algorithm>
#define ll long long
int main()
{
	 ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll input[3];
	cin>>input[0]>>input[1]>>input[2];
	sort(input,input+3);
	ll m=input[2];
	ll n=input[1];
	ll o=input[0];
	ll ans=0;
	if(m==n&&n==o)
	{
		cout<<m<<endl;
		return 0;

	}
	if(m>=n+o)
	{
		cout<<o+n<<endl;
		return 0;
	}
	while(m-o>1)
	{
	  m-=2;
	  n-=1;
	  input[0]=m;
	  input[1]=n;
	  input[2]=o;
	  if(m<0||n<0||o<0)
	  {
	  	cout<<ans<<endl;
	  	return 0;
	  }
	  sort(input,input+3);
	  o=input[0];
	  m=input[2];
	  n=input[1];
	   ans++;

	}
	if(m-o<=1&&o>0)
	{
		ans+=o;
	}

	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define mp make_pair
#define F first
#define S second
#define mod 1000000007
#define vl vector<ll>
#define vi vector<int>
#define pi pair<int,int>
#define pl pair<ll,ll>
#define vpl vector<pl>
#define vpi vector<pi>
#define ml map<ll,ll>
#define mi map<int,int>
#define m(a,b) map<a,b>
#define YesNo(f) if(f){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;continue;}
#define setval(a,val) memset(a,val,sizeof(a))
#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

int main()
{
	fastIO;
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	int t=1;
	while(t--){
		ll a[3],ans=0,x;
		cin>>a[0]>>a[1]>>a[2];
		sort(a,a+3);
		ans+=a[0];
		a[1]-=ans;
		a[2]-=ans;
		x=min(a[1],a[2]/2);
		ans+=x;
		a[1]-=x;
		a[2]-=x;
		x=min(a[2],a[1]/2);
		ans+=x;
		cout<<ans<<endl;

	}

return 0;
}

//gaoshenbaoyou  ------ pass system test
#include <iostream>
#include <sstream>
#include <ios>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cctype>
using namespace std;
#define XINF INT_MAX
#define INF 0x3FFFFFFF
#define MP(X,Y) make_pair(X,Y)
#define PB(X) push_back(X)
#define REP(X,N) for(int X=0;X<N;X++)
#define REP2(X,L,R) for(int X=L;X<=R;X++)
#define DEP(X,R,L) for(int X=R;X>=L;X--)
#define CLR(A,X) memset(A,X,sizeof(A))
#define IT iterator
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<PII> VII;
typedef vector<int> VI;

int main()
{
    ios::sync_with_stdio(false);
    ll a[3];
    while(cin>>a[0]>>a[1]>>a[2])
    {
        ll ans=0;
        sort(a,a+3);
        if(a[2]>=2*(a[0]+a[1]))cout<<a[0]+a[1]<<endl;
        else
        {
            ll temp1;
            while((a[2]-a[1])>1)
            {
                temp1=min(a[2]-a[1],min(a[1]-a[0],(a[2]-a[0])/2));
                a[1]-=temp1;
                a[2]-=temp1*2;
                sort(a,a+3);
                ans+=temp1;
            }
            ans+=a[0];
            a[2]-=a[0];
            a[1]-=a[0];
            ans+=a[1]/3;
            ll tem=a[1]/3;
            a[2]-=tem;
            a[1]-=tem;
            if(a[2]-a[1]==1&&a[1]>0)
            {
                ans++;
                a[2]-=2;
                a[1]-=1;
            }

            cout<<ans<<endl;
        }
    }

    return 0;
}

#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
    long long int j,k,l,r,g,an=0,b;
    cin>>r>>g>>b;
    if(b<=r && b<=g){
        an+=b;
        r-=b;
        g-=b;
        if(r==g){
            an+=r/2;
            if(r-(r/2)>=2 && r%2!=0)
            an+=r%2;
        }

        else if(r<g){
           an+=min(r,g/2);
        }
        else
        an+=min(g,r/2);
    }
    else if(r<=g && r<=b){
        an+=r;
        b-=r;
        g-=r;
        if(b==g){
        an+=b/2;
            if(b-(b/2)>=2 && b%2!=0)
            an+=b%2;
        }
        else if(g<b){
            an+=min(g,b/2);
        }
        else
        an+=min(b,g/2);
    }
    else if(g<=r && g<=b){
        an+=g;
        r-=g;
        b-=g;
        if(r==b){
        an+=r/2;
            if(r-(r/2)>=2 && r%2!=0)
            an+=r%2;
        }
        else if(r<b){
            an+=min(r,b/2);

        }
        else
        an+=min(b,r/2);
    }
    cout<<an;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    long long t[3],res=0,x,a,b;
    for(int i=0;i<3;i++)cin>>t[i];
    sort(t,t+3);
    res+=t[0];
    x=t[0];
    for(int i=0;i<3;i++)t[i]-=x;
    if(t[2]&&!t[1])return cout<<res,0;
    a=t[2];b=t[1];
    res+=(min(a,b)*2+1)/3;
    cout<<res;

    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int r,g,b;
    vector<int>v;
    cin>>r>>g>>b;
    int table=0;
    v.push_back(r);
    v.push_back(g);
    v.push_back(b);
    sort(v.begin(),v.end());

    while(v.size()>1)
    {
        if(v[0]>=1&&v[2]>=2)
        {
            v[0]--;
            v[2]-=2;
            table++;
            sort(v.begin(),v.end());
        }
        else
            break;
    }
    if(v[0]>0) table++;
    else table+=min(v[1],v[2]/2);
    cout<<table<<endl;

    return 0;
}

//by maximumSHOT

#define _USE_MATH_DEFINES

#include <iostream>
#include <cmath>
#include <math.h>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include <time.h>
#include <clocale>
#include <fstream>
#include <conio.h>
#include <random>
#include <bitset>

using namespace std;

#define forx(i,n) for(int i(0);i < n;i++)
#define vec vector
#define mp make_pair
#define ALL(x) (x).begin(), (x).end()

typedef long L;
typedef long long LL;
typedef pair<LL, LL> pll;
typedef long double LD;
typedef vector<int> vint;
typedef vec<LL> vll;
typedef vector<vint> vvint;
typedef vector<double> vdouble;
typedef vector<vector<double>> vvdouble;
typedef vec<bool> vbool;
typedef vec<vec<bool>> vvbool;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef unsigned long long ull;
typedef unsigned int ui;
const int inf = 1000 * 1000 * 1000;
const LL inf64 = LL(inf) * inf;
const LL base  = 1e9+7;
const double pi = acos(-1.0);
template<typename T> inline T Sqr(T a){return a*a;}

// GL begin

// GL end

//Functions begin

//Functions end

bool solve()
{
    ios_base::sync_with_stdio(0);
    //setlocale(LC_ALL, "Russian");
    ifstream fin("input.txt");
    ofstream fout("output.txt");
    //#define cin fin
    //#define cout fout

    LL c[3];

    cin >> c[0] >> c[1] >> c[2];

    sort(c, c + 3);

    LL ans = c[0];
    c[1] -= c[0];
    c[2] -= c[0];

    if(c[1] < c[2] - c[1])
    {
        ans += c[1];
        LL tmp = c[2] - 2 * c[1];
        LL z = c[0];
        ans += min(z, tmp);
        ans -= ((LD)(c[0] - (max(z, tmp) - min(z, tmp))) / 3);
    }else
    {
        ans += (c[2] - c[1]);
        LL q = 2 * c[1] - c[2];
        ans += (q * 2) / 3;
    }

    cout << ans << '\n';

    //_getch();
    return true;
}

int main(int argc,char **argv)
{
   // while(solve());
    solve();

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	vector<long long> rgb(3);
	long long min;
	cin>>rgb[0]>>rgb[1]>>rgb[2];
	sort(rgb.begin(),rgb.end());
	long long res=(rgb[0]+rgb[1]+rgb[2])/3;
	if(rgb[0]+rgb[1]<res)
	{
	    cout<<rgb[0]+rgb[1];
	    return 0;
	}
	min=rgb[0];
	rgb[2]-=rgb[0];
	rgb[1]-=rgb[0];
	rgb[0]=0;
	if(rgb[1]>=2 && rgb[2]>=2)
	{
		min+=(rgb[1]*2)/3;
		if(rgb[1]!=rgb[2])
		min++;
	}
	else if(rgb[1]>=(rgb[2]/2))
	{
		min+=rgb[2]/2;
	}
	else
	min+=rgb[1];
	cout<<min;
	return 0;
}

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<string>
#include<limits.h>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<cassert>
#include<cctype>
#include<cstring>

#define IT(a,it) for(auto it=a.begin(); it != a.end(); it++)
#define ITT(a,it) for(typeof(a.begin()) it=a.begin();it!=a.end();it++)
#define REV_IT(a,it) for(auto it=a.rbegin(); it != a.rend(); it++)
#define REV_ITT(a,it) for(typeof(a.rbegin()) it=a.rbegin(); it != a.rend(); it++)
#define MP make_pair
#define FF first
#define SS second
#define PB push_back
#define INF (int)(1e9)
#define L_INF (LL)(1e18)
#define EPS (double)(1e-9)
#define L_EPS (LD)(1e-18)
#define PI (double)(3.141592653589793238)
#define MAXX 100005

using namespace std;

typedef pair <int, int> pi_i;

bool cmp(int a, int b){ return a>b; }

long long r, g, b, col[5], mi, sum, ma;

int main(){
	ios_base::sync_with_stdio(false);

	cin>>col[0]>>col[1]>>col[2];
	sort(col, col+3);
	if(col[0] + col[1] <= col[3]){
		cout<<col[1]+col[2]<<endl;
	}else{
		cout<<(col[1]+col[2]+col[3])/2<<endl;
	}
return 0;
}

#include<iostream>
#include<map>
#include<string>
#include<string.h>
#include<vector>
#include<stdio.h>
#include <cstdio>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <sstream>
#include <cmath>
#include <bitset>
#include <limits.h>
#include <limits>
#include <utility>
#include <set>
#include <numeric>
#include <functional>
#define all(v) v.begin(),v.end()
#define R(i) freopen(i,"r",stdin)
#define W(i) freopen(i,"w",stdout)
#define R_W R("i.txt"),W("o.txt");
#define FOR(i,f,t) for(int i=f;i<t;i++)
#define r(e) for(int i=0;i<e;i++)
#define inf numeric_limits<int>::max()
#define minf numeric_limits<int>::min()
#define DFS_WHITE -1
#define DFS_BLACK 1
using namespace std;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
vector< vi > AdjList;
vector<long long int> s, l;
int main(){
     R_W;
    long long int n, m;
    long long int a, b, c;
    cin >> a >> b >> c;
    long long int mini = min(a, min(b, c));
    long long int not2[2],id=0;
    int zeros = 0;
    a -= mini; if (a == 0) zeros++; else not2[id++] = a;
    b -= mini; if (b == 0) zeros++; else not2[id++] = b;
    c -= mini; if (c == 0) zeros++; else not2[id++] = c;
    sort(not2, not2 + 2);
    if (zeros ==1){
        long long int diff = abs(not2[0] - not2[1]);
        if (diff > 1){
            long long int vals=((not2[1] - not2[2]) / 2)*2;
            mini += vals;
            not2[1] -= vals;
            sort(not2, not2 + 2);
        }
        mini += min(not2[0], not2[1] / 2);
    }
    cout << mini << endl;
    return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int list[3];

int getSmall()
{
	int ind=min(list[0],min(list[1],list[2]))==list[0]?0:min(list[0],min(list[1],list[2]))==list[1]?1:2;
	return ind;
}
int getBig()
{
	int ind=max(list[0],max(list[1],list[2]))==list[0]?0:max(list[0],max(list[1],list[2]))==list[1]?1:2;
	return ind;
}
int main()
{

	cin>>list[0]>>list[1]>>list[2];
	long long ans=0;
	if(list[0]==list[1]&&list[1]==list[2]){
		ans+=list[0];
		list[0]=list[1]=list[2]=0;
	}
	long long difference=-1;
	while(difference!=0)
	{
		int small=getSmall();
		int big=getBig();
		int med=0;
		if(small==med)
			med=1;
		if(big==med)
			med=2;
		if(small==med)
			med=1;
		if(big==med)
			med=2;
		if(list[small]==list[med]&& list[small]==0)
			break;
		difference=(list[big]-list[small])/2;
		ans+=difference;
		list[big]-=difference*2;
		list[med]-=difference;
	}
	int small=getSmall();
	int big=getBig();
	int med=0;
	if(small==med)
		med=1;
	if(big==med)
		med=2;
	if(small==med)
		med=1;
	if(big==med)
		med=2;
	if(difference==1)
	{
		if(list[small]==list[med]&& list[small]==0)
			cout<<ans;
		else{
			int m=list[getBig()];
			ans+=m;
			cout<<ans;
		}
	}
	else
	{
		if(list[small]==list[med]&& list[small]==0)
			cout<<ans;
		else{
			int m=list[small];
			ans+=m;
			cout<<ans;
		}
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	int r,g,b;
	cin>>r>>g>>b;
	int m = min(r,min(g,b));
	int ans=m;
	r-=m;
	g-=m;
	b-=m;
    if(r==0)
    {
    	ans+=min(max(g,b)/2,min(g,b));
	}
	if(g==0)
    {
    	ans+=min(max(r,b)/2,min(r,b));
	}
	if(b==0)
    {
    	ans+=min(max(g,r)/2,min(g,r));
	}
	cout<<ans;
}

#include<iostream>
#include<algorithm>
#include<new>
#include<vector>
#include<string>
#include<bitset>
#include<utility>
#include<iomanip>
#include<cmath>

#define ull unsigned long long
#define ll long long int

using namespace std;

int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll k=min(min(r,g),b);
    ll ans=k;
    ll a1=max(max(r,g),b);
    ll a2=r+g+b-k-a1;
    a1-=k;
    a2-=k;
    k=min(a1,a2);
    ans+=(k/3)*2;
    a1-=(k/3)*3;
    a2-=(k/3)*3;
    if (min(a1,a2)==1 && max(a1,a2)>=2) ans+=1;
    if (min(a1,a2)==2)
    {
        if (max(a1,a2)>=4) ans+=2;
        else ans+=1;
    }
    cout<<ans;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll inf=1e18;
const ll mod=1e9+7;
const ll maxn=1e4;
ll add(ll a,ll b){
    return ((a%mod)+(b%mod))%mod;
}
ll mul(ll a,ll b){
    return ((a%mod)*(b%mod))%mod;
}
ll powm(ll x,ll n,ll M)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
    return result;
}
int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    vector<ll>v(3);
    for(int i=0;i<3;i++)cin>>v[i];
    sort(v.begin(),v.end());
    if(v[2]>2*(v[0]+v[1]))v[2]=2*(v[0]+v[1]);
    cout<<(v[0]+v[1]+v[2])/2;

   return 0;
}

#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main() {
    ll A[3];
    cin>>A[0]>>A[1]>>A[2];
    sort(A, A + 3);
    if(A[1] == A[2] ) {
        cout<<A[0] + 2 * (A[1] - A[0] / 3)<<endl;
    }
    else
        cout<<A[0] + min((A[2] - A[0]) / 2, A[1] - A[0])<<endl;
}

#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define Raghav main

int Raghav()
{
	vector<int> v(3);
	int ans=0,t;
	cin>>v[0]>>v[1]>>v[2];

	while(1)
	{

		sort(v.begin(), v.end());
		//cout<<v[0]<<" "<<v[1]<<" "<<v[2]<<endl;
		if(v[0]==0)
		{
			//cout<<"1"<<endl;
			t=min(v[1],v[2]/2);
			while(t!=0)
			{
				ans=ans+t;
				v[1]=v[1]-t;
				v[2]=v[2]-2*t;
				sort(v.begin(), v.end());
				t=min(v[1],v[2]/2);
			}

			break;
		}
		if(v[2]>=2*((long long int)v[1]+v[0]))
		{
			//cout<<"2"<<endl;
			ans=ans+v[1]+v[0];
			break;
		}

		else
		{
			//cout<<"3"<<endl;
			t=min(v[0],v[2]/2);
			if(t==0)
			{
				if(v[0]==1)
					ans=ans+1;
				break;
			}
			ans=ans+t;
			v[0]=v[0]-t;
			v[2]=v[2]-2*t;
		}
	}

	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
long long int comb(long long int n,long long int r){
    if(n-r<r)r=n-r;
    long long int p=1;
    for(int i=1;i<=r;i++)p*=(n-r+i)/i;
    return p;
}
int main(){
long long int a[3];cin>>a[0]>>a[1]>>a[2];
sort(a,a+3);
long long int c=0;c+=a[0];
a[1]-=a[0];a[2]-=a[0];
if(a[2]>=2*a[1])c+=min(a[1],a[2]);
else c+=a[2]/2;
cout<<c;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <assert.h>

#define in freopen("input.txt", "r", stdin);
#define out freopen("output.txt", "w", stdout);
#define clr(arr, key) memset(arr, key, sizeof arr)
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define infinity (1 << 28)
#define LL long long
#define PI acos(-1)
#define gcd(a, b) __gcd(a, b)
#define CF ios_base::sync_with_stdio(0);cin.tie(0);
#define lcm(a, b) ((a)*((b)/gcd(a,b)))
#define all(v) v.begin(), v.end()
#define no_of_ones __builtin_popcount // count 1's in a numbers binary representation
#define SZ(v) (int)(v.size())
#define eps 10e-7

//int col[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//int row[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//int col[4] = {1, 0, -1, 0};
//int row[4] = {0, 1, 0, -1};
//int months[13] = {0, ,31,28,31,30,31,30,31,31,30,31,30,31};

using namespace std;

struct point{int x, y; point () {} point(int a, int b) {x = a, y = b;}};    // for coordinates;

template <class T> T sqr(T a){return a * a;}    // square
template <class T> T power(T n, T p) { T res = 1; for(int i = 0; i < p; i++) res *= n; return res;}     //  n  to the power p
template <class T> double getdist(T a, T b){return ((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));}    // distance between a and b
template <class T> T extract(string s, T ret) {stringstream ss(s); ss >> ret; return ret;}    // extract words or numbers from a line
template <class T> string tostring(T n) {stringstream ss; ss << n; return ss.str();}    // convert a number to string
template <class T> inline T Mod(T n,T m) {return (n%m+m)%m;}    // negative mod
template <class T> void print_all(T v) {for(int i = 0; i < v.size(); i++) cout << v[i] << ' ';};
template <class T> void print_all(T &v, int len) {for(int i = 0; i < len; i++) cout << v[i] << ' ';}     // prints all elements in a vector or array
template <class T> void print_pair(T v, int len) {for(int i = 0; i < len; i++) cout << v[i].first << ' ' << v[i].second << endl;} // prints pair vector
LL bigmod(LL B,LL P,LL M){LL R=1; while(P>0)  {if(P%2==1){R=(R*B)%M;}P/=2;B=(B*B)%M;} return R;}

#define MAX 200010
/*************************************************HABIJABI ENDS HERE******************************************************/

int main()
{
    #ifdef Evan
//        in;
//        out;
    #endif
    CF
    LL r, g, b, res = 0;
    cin >> r >> g >> b;
    while(1)
    {
        vector <LL> tem;
        tem.pb(r);
        tem.pb(g);
        tem.pb(b);
        sort(all(tem));
        r = tem[0];
        g = tem[1];
        b = tem[2];
//        cout << r << " " << g << ' ' << b << endl;
        if(b >= g * 2 && g)
        {
//            cout << b << "ic" << ' ' << g << endl;
            res += g;
            b -= (2 * g);
            g = 0;
        }
        else if(min(r, min(g, b)))
        {
            LL c = min(r, min(g, b));
            res += c;
            r -= c;
            g -= c;
            b -= c;
        }
        else
        {
            res += min(b / 2, g);
            break;
        }
    }
    cout << res << endl;
    return 0;
}

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include"bits/stdc++.h"
using namespace std ;
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define bug( x ) cerr << #x << '=' <<x << '\n' ;
template<typename T>
T  choose(T a, T b,T c){
 if(a<b && a >c || a>b && a<c )return a;
 else if(b<a && b>c || b>a && b<c)return b;
 return c;
}

const int N=1e8;

ll t , r ,g ,b ,avg ;

int main(){

	IOS

	cin >> r >> g >> b ;

	avg= (r+g+b)/3LL;

	if((r>=avg && g>=avg) || (g>=avg && b>=avg) || (r>=avg && b>=avg))cout << avg;

	else cout << choose(r,g,b) ;

	cout<<'\n';

}

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int a[3];
    for(int i=0;i<3;i++){cin>>a[i];}
    sort(a,a+3);
    int t=a[0];
    if(a[1]-a[0]+a[2]-a[0]>=3){
        t+=(a[1]+a[2]-a[0]*2)/3;
    }
    cout<<t;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
	int a,b,c;
cin>>a>>b>>c;
	 cout<<min((a+b+c)/3,min(a+b,min(b+c,a+c)));

	return 0;
}

#include <bits/stdc++.h>
//Yohohohohohohohohohoohohohohoohohohohhoho
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    int s[3], ans = 0;
    scanf("%d%d%d", &s[0], &s[1], &s[2]);
    sort(s, s + 3);
    int a = s[1] - s[0];
    int b = s[2] - s[0];
    ans += (a + b) / 3;
    ans += (s[0] * 3) / 3;
    cout << ans << endl;
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int main()
{
    int a[3];
    for(int i=0;i<3;i++)
        scanf("%d",&a[i]);
    sort(a,a+3);
    if(a[0]+a[1]>(a[2]/2))
    {
        int sum=a[0]+a[1]+a[2];
        printf("%d\n",sum/3);
    }
    else
    {
        printf("%d\n",a[0]);
    }
}

/* Please don't hack me... */
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<deque>
#include<fstream>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<utility>
#include<vector>

using namespace std;

#define dbg(x) (cout<<#x<<" = "<<(x)<<'\n')
#define inputFile "input.txt"
#define outputFile "output.txt"

typedef long long int lld;
typedef pair<int, int> PII;

const int INF = (1LL << 31) - 1;
const lld LINF = (1LL << 62) - 1;

const int NMAX = 100000 + 5;
const int MMAX = 100000 + 5;
const int KMAX = 100000 + 5;
const int PMAX = 100000 + 5;
const int LMAX = 100000 + 5;
const int VMAX = 100000 + 5;

lld min(lld a, lld b, lld c) {
    return min(min(a, b), c);
}

lld max(lld a, lld b, lld c) {
    return max(max(a, b), c);
}

lld m, n, p, r, g, b, sol, q;

int main() {
#ifndef ONLINE_JUDGE
    freopen(inputFile, "r", stdin);
    freopen(outputFile, "w", stdout);
#endif

    scanf("%lld%lld%lld", &r, &g, &b);

    while(!(r == g && g == b && r == b) && g && r + g + b >= 3) {
        m = max(r, g, b);
        p = min(r, g, b);
        n = r + g + b - m - p;

        q = min(m / 2, n);
        sol += q;
        m -= 2 * q;
        n -= q;

        r = m;
        g = n;
        b = p;
    }

    sol += min(r, g, b);

    printf("%lld\n", sol);

    return 0;
}

#include <iostream>
#include "bits/stdc++.h"
#define pb push_back
#define int long long
#define mp make_pair
#define se second
#define fi first
using namespace std;

signed main()
{
    int t=1;
    int mod=1e9;
    for(int gg=1;gg<=t;gg++)
    {

       int a,b,c;
       cin>>a>>b>>c;
       int maxi=max(a,max(b,c));
       int mini=min(a,min(b,c));
       int _max=a+b+c-maxi-mini;
       cout<<mini+min((maxi-mini)/2,_max-mini);

    }
}

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <limits.h>
using namespace std;
bool comp(int a,int b)
{
    return (a>b);
}
int gcd(int a,int b)
{
    if(b==0)
        return a;
    else
        return gcd(b,a%b);
}
int main(void) {
    int n,m,p,r;
    long long int km=0,kma=0;
    cin>>n>>m;
    kma=1LL*(n-m+1)*(n-m)/2;
    r=n-m;
    p=ceil(r*1./m);
    if(n%m)
    {
        km=1LL*p*(p+1)/2*(n%m);
        p--;
        km+=1LL*(p)*(p+1)/2*(m-n%m);
    }
    else
        km=1LL*p*(p+1)/2*(m);
    cout<<km<<" "<<kma;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define mp make_pair
#define F first
#define S second
#define mod 1000000007
#define vl vector<ll>
#define vi vector<int>
#define pi pair<int,int>
#define pl pair<ll,ll>
#define vpl vector<pl>
#define vpi vector<pi>
#define ml map<ll,ll>
#define mi map<int,int>
#define m(a,b) map<a,b>
#define YesNo(f) if(f){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;continue;}
#define setval(a,val) memset(a,val,sizeof(a))
#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

int main()
{
	fastIO;
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	int t=1;
	while(t--){
		ll a[3],ans=0,x;
		cin>>a[0]>>a[1]>>a[2];
		if(a[0]==a[2]==a[1]){
			ans=a[0];
			goto printAns;
		}
		sort(a,a+3);
		x=a[0]/2;
		a[0]-=2*x;
		a[2]-=x;
		ans+=x;
		x=min(a[0],a[2]/2);
		a[0]-=x;
		a[2]-=2*x;
		ans+=x;
		sort(a,a+3);
		x=max((ll)0,2*a[1]-a[2]);
		a[1]-=x;
		a[2]-=x;
		ans+=a[1];
		x/=3;
		x*=2;
		ans+=x;
		printAns:
		cout<<ans<<endl;
	}

return 0;
}