#include "bits/stdc++.h" using namespace std; int main() { long long X, Y, Z, ANS; cin >> X >> Y >> Z; ANS = Z; if (X <= Z) ANS--; if (Y <= Z) ANS--; cout << ANS << endl; }