#include #include #include #include #include #include #include using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; int X, Y, Z; cin >> X >> Y >> Z; int ans = 0; for(int i = 0; i <= Z; i++){ ans = max(ans, min(X+Z-i, Y+i)); } cout << ans << endl; }