#include int main(void){ long int x,y,z; scanf("%ld%ld%ld",&x,&y,&z); if (y<=z) { printf("%ld\n",z-2); } else if (x<=z) { printf("%ld\n",z-1); } else { printf("%ld\n",z); } return 0; }