#include #include #include using namespace std; vector RGB; bool solve(int x) { bool flag = false; int need = 0, amari = 0; for (int i = 0; i < 3; i++) { if (RGB[i] < x)need += (x - RGB[i]); else amari += (RGB[i] - x) / 2; } return amari >= need; } int main() { RGB.resize(3); cin >> RGB[0] >> RGB[1] >> RGB[2]; long long left = -1; long long right = 10000001; int mid; while (left < right) { mid = (left + right) / 2; if (!solve(mid)) { right = mid; } else { left = mid + 1; } } cout << left-1 << endl; return 0; }