#include using namespace std; #define endl '\n' #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<()) #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<30 #define v(T) vector #define vv(T) v(v(T)) #define print(x) cout<<(x)<> v[i] typedef vector vi; typedef vector vl; typedef vector vd; typedef pair pii; typedef pair pll; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b void debug_print(Head&& head, Tail&&... tail) { cout << (head) << endl; debug_print(forward(tail)...); } int i, j, k; int main() { cin.tie(0); ios::sync_with_stdio(false); ll x, y, z; ll ans; cin >> x >> y >> z; ans = z; if (z >= x) { ans--; chmax(ans, (ll)0); } if (z >= y) { ans--; chmax(ans, (ll)0); } print(ans); return 0; }