#include #include using namespace std; typedef long long int ll; int main(){ ll x,y,z; cin >> x >> y >> z; int ans=0; if(x<=z)ans--; if(x!=y&&y<=z)ans--; cout << ans+z << endl; }