#include using namespace std; int main() { int x, y, z; cin >> x >> y >> z; cout << z - (x <= z) - (y <= z) << endl; }