X,Y,Z=map(int,input().split()) cnt=0 if X <=Z: cnt+=1 if Y <=Z: cnt+=1 print(Z-cnt)