#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ int r, g, b; ll ans = 0; cin >> r >> g >> b; vector l = {r, g, b}; do { int t; sort(l.begin(), l.end()); t = l[0]; ans += t; l[0] -= t; l[1] -= t; l[2] -= t; t = 0; if (l[1] >= 5 && (l[2] - l[1] < 2)){ t = l[1]/5; l[0] += t*2; l[1] -= t*2; l[2] -= t*2; } else if (l[1] >= 5 && (l[2] - l[1])/2 >= l[1]){ t = l[1]; l[0] += t; l[2] -= t*2; } else if (l[1] >= 5 && (l[2] - l[1])/2 < l[1]){ t = (l[2] - l[1])/2; l[0] += t; l[2] -= 2*t; } else if (l[1] == 0){ if (l[2] < 5) break; else { t = l[2]/5; l[0] += t; l[1] += t; l[2] -= t*4; } } else if (l[2] >= l[1]*3){ t = l[1]; l[0] += t; l[2] -= 2*t; } else if (l[2] >= 3) { l[0]++; l[2] -= 2; } } while ((l[0] != 0 && l[1] != 0 && l[2] != 0) || l[2] >= 3); cout << ans << endl; }