#include using namespace std; using ll = long long; #define rep(i,s,n) for(ll i = (s); i < (n); i++) #define rep0(i,n) rep(i,0,n) #define rep1(i,n) rep(i,1,n+1) #define repR(i,s,n) for(ll i = (n-1); i >= (s); i--) #define repR0(i,n) repR(i,0,n) #define repR1(i,n) repR(i,1,n+1) #define BR "\n" #define SP " " #define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << SP; } cout << BR; #define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << BR; #define fcout cout << fixed << setprecision(18) int dx[4]={1,0,-1,0}; int dy[4]={0,1,0,-1}; int a[100]; int cells[100][100]; // r * c int main() { ll X, Y, Z; cin >> X >> Y >> Z; ll ans = 0; rep0(i, Z + 1) { ans = max(ans, min(X + i, Y + (Z - i))); } cout << ans << BR; return 0; }