#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    ll x, y, z;
    cin >> x >> y >> z;

    cout << z - (z >= x) - (z >= y) << endl;

    return 0;
}