#include using namespace std; #define REP(i,a) for(int i = 0; i < (a); i++) #define ALL(a) (a).begin(),(a).end() typedef long long ll; typedef pair P; const int INF = 1e9; const int MOD = 1e9 + 7; signed main(){ ll x,y,z; cin >> x >> y >> z; if(x <= z && y <= z){ cout << z - 2 << endl; }else if(x > z && y > z){ cout << z << endl; }else{ cout << z - 1 << endl; } }