#include using namespace std; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(i,a,b) for (int i = (a); i < (b); i++) #define RFOR(i,a,b) for (int i = (b)-1; i >= (a); i--) #define REP(i,n) for (int i = 0; i < (n); i++) #define RREP(i,n) for (int i = (n)-1; i >= 0; i--) #define ALL(x) (x).begin(), (x).end() #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++) #define BIT(n) (1LL<<(n)) #define SZ(x) ((int)(x).size()) typedef long long ll; // ------------------------------------- int ma, mi, mu; bool check(int x) { if (mi >= x) return true; else if (mu >= x) { int a = ma - x; int u = mu - x; return a / 2 + u / 2 + mi >= x; } else { int a = ma - x; a -= (x - mu) * 2; a -= (x - mi) * 2; return a >= 0; } } int main() { int R, G, B; cin >> R >> G >> B; ma = max({R, G, B}); mi = min({R, G, B}); mu = R + G + B - ma - mi; int ok = 0; int ng = ma + 1; while (abs(ok - ng) > 1) { int mid = (ok + ng) / 2; bool c = check(mid); //_P("%d, %d, %d -> %d\n", ok, ng, mid, c); if (c) ok = mid; else ng = mid; } cout << ok << endl; return 0; }