#include using namespace std; #include using namespace atcoder; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair #define LP pair int main() { int x, y, z; cin >> x >> y >> z; if (x+z <= y) cout << x+z << endl; else if (y+z <= x) cout << y+z << endl; else cout << (x+y+z)/2 << endl; }