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