#include #include #include #include #define ll long long using namespace std; int main() { ll x,y,z; cin>>x>>y>>z; ll ans=z; if(z>=x and z>0) ans-=1; if(z>=y and z>0) ans-=1; cout<