#include #include using namespace std; typedef long long ll; int main() { ll X, Y, Z; cin >> X >> Y >> Z; ll ans = Z; if(X <= Z) ans--; if(Y <= Z) ans--; cout << max(ans, 0LL) << endl; return 0; }