x,y,z=map(int,input().split()) ans=z; if(x<=z): ans-=1 pass; if(y<=z): ans-=1 pass; print(ans)