#include using namespace std; int main() { long long a, b, c, ans; cin >> a >> b >> c; if (b <= c) { ans = c - 2; } else if (a <= c) { ans = c - 1; } else { ans = c; } cout << setprecision(20) << ans << endl; return 0; }