#include int main() { long long x, y, z; scanf("%lld%lld%lld", &x, &y, &z); printf("%lld\n", z - (x<=z) - (y<=z)); }