#include using namespace std; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); long long x, y, z; cin >> x >> y >> z; long long ans = z; if(x <= z) ans--; if(y <= z) ans--; cout << ans << endl; return 0; }