#include using namespace std; #pragma GCC optimize("Ofast") #define all(x) (x).begin(),(x).end() #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define REP(i, m, n) for(int i = m; i < n; i++) #define SORT(v) sort(all(v)) #define REV(v) sort((v).begin(), (v).end(), greater()) #define INF 1000000007 #define fcout cout << fixed << setprecision(15) typedef long long ll; typedef pair P; int gcd(int a,int b){return b?gcd(b,a%b):a;}; int lcm(int a,int b){return a * b / gcd(a, b);}; int mod(int a,int b){return (a+b-1)/b;}; int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; template void Fill(A (&array)[N], const T &val){std::fill( (T*)array, (T*)(array+N), val );}; templateinline bool chmax(T& a,T b){if(a < b){a=b;return true;}return false;}; templateinline bool chmin(T& a,T b){if(a > b){a=b;return true;}return false;}; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); int x, y, z; cin >> x >> y >> z; int ans = z; if(x <= z) ans--; if(y <= z) ans--; cout << ans << endl; return 0; }