#include using namespace std; typedef signed long long ll; typedef long double ld; #define rep(i,n) for(int i = 0; i < (n); i++) #define all(x) x.begin(),x.end() #define DEBUG int main() { int x, y, z; cin >> x >> y >> z; for(int i = z; i > 0; i--) { if(x < y) { x++; z--; } else { y++; z--; } } int ans = min(x, y); cout << ans << endl; return 0; }