#include #define p(s) cout<<(s)<>x>>y>>d; int ans; if(x+y=d&&y>=d) ans=d+1; else ans=min(d,x)+1-max(d-y,0); p(ans); return 0; }