#include #include #include #include #include #define all(x) x.begin(),x.end() #define pb push_back #define ll long long #define P pair #define LP pair using namespace std; int main() { int a, b, c; int ans=0; cin >> a>>b>>c; if (a > b and b>0) { ans += b; for (int i = 1; i <= c; i++) { ans += 1; c -= 1; if (ans == a) break; } } else if (b > a and a>0) { ans += a; for (int i = 1; i <= c; i++) { ans += 1; c -= 1; if (ans == b) break; } } else if (a == 0 ) { for (int i = 1; i <= c; i++) { ans += 1; c -= 1; if (ans == b) break; } } else if (b == 0) { for (int i = 1; i <= c; i++) { ans += 1; c -= 1; if (ans == a) break; } } else ans += a; ans += c / 2; cout << ans << endl; return 0; }