#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); function)> dfs = [&](vector A) -> int { int res = *min_element(A.begin(), A.end()); rep(i,3) A[i] -= res; int argMax = max_element(A.begin(), A.end()) - A.begin(); int argMin = min_element(A.begin(), A.end()) - A.begin(); if(argMax == argMin || A[argMax] <= 1) return res; else { A[argMax] -= 2; A[argMin] += 1; return res + dfs(A); } }; vector A(3); rep(i,3) cin >> A[i]; cout << dfs(A) << endl; }