a,b,c=map(int,input().split()) ans=c if a<=c:ans-=1 if b<=c:ans-=1 print(ans)